XWT + DataBinding +DataContext +Replace [message #505197] |
Mon, 28 December 2009 09:21  |
Eclipse User |
|
|
|
Problem
---------
In my java code, I have the following
oC = (Control) XWT.load(parent, url, loadModel("SG.xml"));
System.out.println ( XWT.getDataContext(oC)) ;
I would like to refresh the TableViewer with the contents of SGNew.xml in
the runtime.
Since I didn't see setDataContext such as
XWT.setDataContext(oC,loadModel("SGNew.xml")),
I tried setting the input of TableViewer with the result of
loadModel("SGNew.xml"), obviously it threw the following error
"org.eclipse.core.runtime.AssertionFailedException: assertion failed: This
content provider only works with input of type IObservableList"
What is the best way to proceed ?
Thanks,
Best Regards,
Walter G. Prabhakar.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #505211 is a reply to message #505197] |
Mon, 28 December 2009 10:59  |
Eclipse User |
|
|
|
The error message states that you are using the wrong data provider.
There is a xml data provider (..e4.xwt.xml) to be used for xml data.
Though, I am not sure how mature the data provider is.
In your binding declaration you will have to use xpath expressions, e.g.:
{Binding path=//users/@name}
Afaik, you can only set the data context once, prior to loading the UI.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #505235 is a reply to message #505197] |
Sun, 27 December 2009 23:45  |
Eclipse User |
|
|
|
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hhaeth$s4v$1@build.eclipse.org...
> Problem
> ---------
> In my java code, I have the following
>
> oC = (Control) XWT.load(parent, url, loadModel("SG.xml"));
> System.out.println ( XWT.getDataContext(oC)) ;
>
> I would like to refresh the TableViewer with the contents of SGNew.xml in
> the runtime.
You can always to get the file content, create a IObservableList to pass and
then pass it to TableViewer. But you need to know data binding framework.
>
> Since I didn't see setDataContext such as
> XWT.setDataContext(oC,loadModel("SGNew.xml")),
> I tried setting the input of TableViewer with the result of
> loadModel("SGNew.xml"), obviously it threw the following error
> "org.eclipse.core.runtime.AssertionFailedException: assertion failed: This
> content provider only works with input of type IObservableList"
>
> What is the best way to proceed ?
The simple way is just to reload the XWT resource to recreate UI with new
data context.
Best regards
yves
>
> Thanks,
> Best Regards,
> Walter G. Prabhakar.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #505236 is a reply to message #505211] |
Sun, 27 December 2009 23:48  |
Eclipse User |
|
|
|
By now, It is a POC. We need to develop more tests. Particuliarly, the xpath
expression may have a problem with some special characters.
yves
"Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
news:hhakli$evi$1@build.eclipse.org...
> The error message states that you are using the wrong data provider.
> There is a xml data provider (..e4.xwt.xml) to be used for xml data.
> Though, I am not sure how mature the data provider is.
>
> In your binding declaration you will have to use xpath expressions, e.g.:
>
> {Binding path=//users/@name}
>
> Afaik, you can only set the data context once, prior to loading the UI.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #566789 is a reply to message #505197] |
Mon, 28 December 2009 10:59  |
Eclipse User |
|
|
|
The error message states that you are using the wrong data provider.
There is a xml data provider (..e4.xwt.xml) to be used for xml data.
Though, I am not sure how mature the data provider is.
In your binding declaration you will have to use xpath expressions, e.g.:
{Binding path=//users/@name}
Afaik, you can only set the data context once, prior to loading the UI.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #566799 is a reply to message #505197] |
Sun, 27 December 2009 23:45  |
Eclipse User |
|
|
|
"Walter Prabhakar" <kwchess@gmail.com> wrote in message
news:hhaeth$s4v$1@build.eclipse.org...
> Problem
> ---------
> In my java code, I have the following
>
> oC = (Control) XWT.load(parent, url, loadModel("SG.xml"));
> System.out.println ( XWT.getDataContext(oC)) ;
>
> I would like to refresh the TableViewer with the contents of SGNew.xml in
> the runtime.
You can always to get the file content, create a IObservableList to pass and
then pass it to TableViewer. But you need to know data binding framework.
>
> Since I didn't see setDataContext such as
> XWT.setDataContext(oC,loadModel("SGNew.xml")),
> I tried setting the input of TableViewer with the result of
> loadModel("SGNew.xml"), obviously it threw the following error
> "org.eclipse.core.runtime.AssertionFailedException: assertion failed: This
> content provider only works with input of type IObservableList"
>
> What is the best way to proceed ?
The simple way is just to reload the XWT resource to recreate UI with new
data context.
Best regards
yves
>
> Thanks,
> Best Regards,
> Walter G. Prabhakar.
|
|
|
Re: XWT + DataBinding +DataContext +Replace [message #566823 is a reply to message #505211] |
Sun, 27 December 2009 23:48  |
Eclipse User |
|
|
|
By now, It is a POC. We need to develop more tests. Particuliarly, the xpath
expression may have a problem with some special characters.
yves
"Erdal Karaca" <erdal.karaca.de@googlemail.com> wrote in message
news:hhakli$evi$1@build.eclipse.org...
> The error message states that you are using the wrong data provider.
> There is a xml data provider (..e4.xwt.xml) to be used for xml data.
> Though, I am not sure how mature the data provider is.
>
> In your binding declaration you will have to use xpath expressions, e.g.:
>
> {Binding path=//users/@name}
>
> Afaik, you can only set the data context once, prior to loading the UI.
|
|
|
Powered by
FUDForum. Page generated in 0.03997 seconds