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
Member
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="http://www.eclipse.org/xwt/presentation" 
		   xmlns:x="http://www.eclipse.org/xwt"
		   xmlns:y="clr-namespace:testapplication.uicontainers"
	 	   x:DataContext="{StaticResource myData}"
	 	   BindingContext="{StaticResource myDBC}">
	 	   
	<x:Composite.Resources>
		<y:Person x:Key="myData"/>
		<BindingContext x:Key="myDBC"/>
	</x:Composite.Resources>
	 	   
	<Composite.layout>
		<RowLayout/>
	</Composite.layout>
	
	<Text x:Style="BORDER" text="{Binding UpdateSourceTrigger=PropertyChanged, path=name}"/>
	<Button x:Class="PersonUIContainer" text="New Button" SelectionEvent="onSelection"/>

</Composite>


	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
			e.printStackTrace();
		}
	}

	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
weinma
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: 854
Registered: July 2009
Senior Member
I am not sure if the Composite.Resources node should be in the x namespace: try without ns prefix...

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


Current Time: Wed Apr 24 22:59:41 GMT 2024

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

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

Back to the top