I’m building my first GWT app, designed in MVP pattern. Now I’ve got a view which should populate a DTO which has many fields (aprox. 20). I want it make it clean here what would be the cleanest/less painful way to pass all these widgets/values to my dto?
Creating for each DTO field a widget and passing the value by a onClickHandler? This would be a lot of boilercode, there must be another way. There is a FormPanel but while reading the GWT mailing list it should be used only on file uploads.
Just for sake of completeness: I’m using GWTP for my project which simplifies the basic MVP stuff.
If you are looking for a databinding solution than you should take a look at GWT’s ui editors.
From the GWT Docs:
The editor framework uses a combination of deferred-binding and naming convention to reduce boiler plate code. The system is highly-customizable so you can use annotations to specify editor for bean properties, if for some reason you cannot follow the naming convention.