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
Thanks and best regards
weinma