MVPを使用したGWTでのフォーム送信のベストプラクティスを探しています。
私のアプリケーションでは、単純なfromがレンダリングされるダイアログボックスが開きます。「OK」ボタンをクリックすると、要素値が読み取られ、値オブジェクトに割り当てられます。次に、このオブジェクトは新しいプレイスに追加されます。
意見:
onOkButtonClicked(event){
// read values from dialog box elements
// assign the values to ValueObject(name, number, address)
presenter.goto(new ListRecordPlace("list","addrecord", valueObject);
}
アクティビティ:
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());
}
}
これは、MVPアクティビティと場所を使用してサーバーにデータを送信する正しい方法ですか?