I'm looking for some best practices for form submission in GWT with MVP.
In my application a Dialog box is opened where a simple from is rendered. When the 'Ok' button is clicked, element values are read and assigned to a value object. This object is then added to a new Place.
View:
onOkButtonClicked(event){
// read values from dialog box elements
// assign the values to ValueObject(name, number, address)
presenter.goto(new ListRecordPlace("list","addrecord", valueObject);
}
Activity:
ListRecordActivity(ListRecordPlace place, eventBus){
this.place = place;
}
start(...){
if(this.place.getAction().equals("addrecord")){
// RPC call to add the new record: this.place.getNewRecord();
// RPC returns list of records
view.setRecordList();
container.setWidget(view.asWidget());
}
}
Is this the right way to submit data to server with MVP Activities and Places?