Search code examples
formsgoogle-app-enginegwtgwt-rpc

GWT "big" Forms


I completed the StockWatcher basic gwt tutorial, and read several pages of documentation but I can't find the solution for a very simple thing.

What if my stock was a "real" object, such as an invoice, with dozens of fields to be entered by hand?b

I suppose I have to write a panel with many text boxes, and on the 'OK' button click, retrieve each textbox value in a awful way:

codeTb.getText();
year.getText();
customerTb.getText();
...

Then build a POJO-DTO and send through the RPC wire.

Really, isn't there a more simple way?

I think about a concept of "Form" in Gwt. Sorry, maybe I didn't find it in the doc, yet.


Solution

  • GWT has what are called Editors. With Editors you can bind Widgets to a DTO and it's fields, so you don't have to do the getText or setText yourself. It's not totaly trivial to use, but you can find more details in the GWT documentation: http://code.google.com/webtoolkit/doc/latest/DevGuideUiEditors.html