wood burning stoves 2.0*
The moose likes GWT and the fly likes GWT Form data binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "GWT Form data binding" Watch "GWT Form data binding" New topic

GWT Form data binding

Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 166
Hi All
I'm starting with GWT app and was wondering how we would go about binding form fields to form just like struts . Say i have a Person object which has name age sex Adress ( which itself has addline1,line2 city and country). Say i were to use this for my page and the generic person details like name age etc displayed as a tree node and the adress details displayed on another node. I need to save/ display these. I know how to do this in struts spring etc but not sure about GWT. I do not want to bind each field like a normal servlet/jsp app by getting it using request params. Also, another issue i foresee is that, say a user enters only name and goes to the address node to fill address, once he come back to the first node, the name he entered should be present.

I need a starting point from which i can take off on my own. Starting to look at editors.
Any help on this would be appreciated.

Warm Regards

If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 166
Hi All
I got the form submit part working. From my form panel, which i named formPanel, all i need to do is to call the submit method.

All widgets whose name is set using the widget.setName("shouldMatchAttributeNameOfDTO") matches that of the DTO will get set in the respective attributes. As we used Spring, all i had to do in my controller is to write a method

where Person is the data transfer object.

However, i where i am still stuck is holding the data in my 2 panels. My First panel has generic info about a person like name age etc and the second panel has address details. I am able to save both panels individually, but if i enter data in my first panel and traverse to the address panel, only the address portion gets saved. I also loose the data which i enter in the panel once i navigate to the other panel.

If someone has thoughts on how to do this, i would be most eager to know.

Thanks in advance\
I agree. Here's the link: http://aspose.com/file-tools
subject: GWT Form data binding
Similar Threads
jsf table binding attribute help needed
Recurring fields in formbean
Selecting results from a search
Access JFrame Components from JDialog
Process multiple node occurences using JAXB