Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Another XWT Validation Trouble
Another XWT Validation Trouble [message #931460] Wed, 03 October 2012 08:15 Go to next message
Jürgen Weinberger is currently offline Jürgen WeinbergerFriend
Messages: 42
Registered: August 2012
Hey everyone!

I have a little problem with the validation mechanism in xwt. I hope somebody can help me.

I am stuck with the declaration of the xwt binding context in the xwt-file.
As soon as i insert the BindingContext={StaticResource myDBC} i get an exception that the key "myDBC" cannot be found.
But as i saw in the test-cases of xwt it should not be necessary to append anything in the loading options or somewhere else in the java code or am i wrong?
Without the BindingContext everything works fine and by the way i am using xwt in an RCP application.

<Composite xmlns="" 
	 	   x:DataContext="{StaticResource myData}"
	 	   BindingContext="{StaticResource myDBC}">
		<y:Person x:Key="myData"/>
		<BindingContext x:Key="myDBC"/>
	<Text x:Style="BORDER" text="{Binding UpdateSourceTrigger=PropertyChanged, path=name}"/>
	<Button x:Class="PersonUIContainer" text="New Button" SelectionEvent="onSelection"/>


	private void loadFromURL() {
		try {
			XWT.setLoadingContext(new DefaultLoadingContext(this.getClass().getClassLoader()));
			loadedControl = (Control)XWT.loadWithOptions(xwtFile, getOptions());
		} catch (Exception e) {
			// TODO Auto-generated catch block

	private Map<String, Object> getOptions() {
		HashMap<String, Object> xwtLoadingOptions = new HashMap<String, Object>();
		xwtLoadingOptions.put(XWTLoader.CLASS_PROPERTY, this);
		xwtLoadingOptions.put(XWTLoader.CONTAINER_PROPERTY, parentControl);
		if(model!=null) {
			xwtLoadingOptions.put(XWTLoader.DATACONTEXT_PROPERTY, model);
		return xwtLoadingOptions;

Any help would be appreciated Smile
Thanks and best regards
Re: Another XWT Validation Trouble [message #931703 is a reply to message #931460] Wed, 03 October 2012 12:49 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 853
Registered: July 2009
Senior Member
I am not sure if the Composite.Resources node should be in the x namespace: try without ns prefix...

Previous Topic:How to make perspective buttons right aligned ?
Next Topic:import org.eclipse.e4.ui.di.Focus; failing
Goto Forum:

Current Time: Sat Apr 10 12:36:12 GMT 2021

Powered by FUDForum. Page generated in 0.01707 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top