Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XWT » Dynamic databinding using XWT(Dynamic databinding using XWT)
icon5.gif  Dynamic databinding using XWT [message #1062626] Mon, 10 June 2013 07:24 Go to next message
Devesh Mishra is currently offline Devesh MishraFriend
Messages: 20
Registered: June 2013
Junior Member
I am working on a small application which will do the following.

1) Have a dropdown on the UI populated from the database.
2) Have two text boxes on the UI.
2) Clicking on the Submit button should save the values to database.

I understand that this can be done using POJO binding, but the requirement is something like below.

1) No POJO class to be used for binding. The dropdown should be populated using xwt configuration. XML binding ? I tried the org.eclipse.e4.xwt.tests.databinding.dataprovider.xml package but get org.eclipse.e4.xwt.XWTException: Property "//book/title" is not found in the class org.eclipse.swt.widgets.Text while executing the test apps.
2) I dont want to do something like findeElemenet("element-name") and save the values to DB.

The requirement is that the designers should be able to make the UI and without much integration effort we should make it working. Any help would be greatly appreciated.
Re: Dynamic databinding using XWT [message #1062809 is a reply to message #1062626] Mon, 10 June 2013 20:03 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
I have not worked with the xml data binding, yet, but your error message is not related to it: it seems that you are missing to set the proper data context in your xwt file or when calling XWT to load it:

It should help us to debug this once you show us (parts of) your xwt configuration.

Devesg Mishra wrote on Mon, 10 June 2013 09:24
I am working on a small application which will do the following.

1) Have a dropdown on the UI populated from the database.
2) Have two text boxes on the UI.
2) Clicking on the Submit button should save the values to database.

I understand that this can be done using POJO binding, but the requirement is something like below.

1) No POJO class to be used for binding. The dropdown should be populated using xwt configuration. XML binding ? I tried the org.eclipse.e4.xwt.tests.databinding.dataprovider.xml package but get org.eclipse.e4.xwt.XWTException: Property "//book/title" is not found in the class org.eclipse.swt.widgets.Text while executing the test apps.
2) I dont want to do something like findeElemenet("element-name") and save the values to DB.

The requirement is that the designers should be able to make the UI and without much integration effort we should make it working. Any help would be greatly appreciated.

Re: Dynamic databinding using XWT [message #1062814 is a reply to message #1062809] Mon, 10 June 2013 20:27 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Just tried with org.eclipse.xwt.tests.databinding.dataprovider.xml.XmlDataProvider_Test and could reproduce the error message. Seems to be a bug: Let us wait for Yves to comment on this...

Erdal Karaca wrote on Mon, 10 June 2013 22:03
I have not worked with the xml data binding, yet, but your error message is not related to it: it seems that you are missing to set the proper data context in your xwt file or when calling XWT to load it:

It should help us to debug this once you show us (parts of) your xwt configuration.

Devesg Mishra wrote on Mon, 10 June 2013 09:24
I am working on a small application which will do the following.

1) Have a dropdown on the UI populated from the database.
2) Have two text boxes on the UI.
2) Clicking on the Submit button should save the values to database.

I understand that this can be done using POJO binding, but the requirement is something like below.

1) No POJO class to be used for binding. The dropdown should be populated using xwt configuration. XML binding ? I tried the org.eclipse.e4.xwt.tests.databinding.dataprovider.xml package but get org.eclipse.e4.xwt.XWTException: Property "//book/title" is not found in the class org.eclipse.swt.widgets.Text while executing the test apps.
2) I dont want to do something like findeElemenet("element-name") and save the values to DB.

The requirement is that the designers should be able to make the UI and without much integration effort we should make it working. Any help would be greatly appreciated.


Re: Dynamic databinding using XWT [message #1062820 is a reply to message #1062814] Mon, 10 June 2013 21:47 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Devesg: could you please file a bug report? - Thanks!
Re: Dynamic databinding using XWT [message #1062854 is a reply to message #1062820] Tue, 11 June 2013 06:18 Go to previous messageGo to next message
Devesh Mishra is currently offline Devesh MishraFriend
Messages: 20
Registered: June 2013
Junior Member
Thanks for the response Erdal. I have raised a bug, id is 410407 .

Is there any other/better way you think my requirement can be implemented using XWT?

Thanks,
Devesh
Re: Dynamic databinding using XWT [message #1062925 is a reply to message #1062854] Tue, 11 June 2013 12:31 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
Devesh,
Another (not sure if better as a bit more complex) way: If you have an XSD for your XML data, then, you could generate an ecore (meta) model from it and use ecore's dynamic models support (i.e. no POJOs and no EMF generated code) along with XWT's EMF data binding support.
So, even no XPath expressions.

Devesh Mishra wrote on Tue, 11 June 2013 08:18
Thanks for the response Erdal. I have raised a bug, id is 410407 .

Is there any other/better way you think my requirement can be implemented using XWT?

Thanks,
Devesh

Previous Topic:XWT and EMF.edit Databinding
Next Topic:No repository is found when creating new XWT interface after installing XWT with version Juno.
Goto Forum:
  


Current Time: Fri Apr 19 00:34:57 GMT 2024

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

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

Back to the top