I have created a form class which is used by a class extending
webpage. When I call the following method in the onSubmit method of
the form button I receive the model attached to another form page (=
requestFormModel) and not (= requestMessageFormModel).
Is there any restrictions/limitations using this method call :
this.getForm().getModelObject()
Here is the code of my RequestMessageForm()
public class RequestMessageForm extends Form {
private static final long serialVersionUID = 1L;
public RequestMessageForm(String name) {
super(name, new CompoundPropertyModel(new RequestMessageFormModel()));
// Add textFields
add(textfieldRequestMessageId);
add(textfieldFromDate);
add(textfieldToDate);
// Add drop down choice
add(dropDownChoiceStatus);
add(dropDownChoiceType);
// Add buttons
add(new Button("bSearchCriteriaRequestMessage") {
@Override
public void onSubmit() {
Log.info("Model received RM : " +
this.getForm().getModelObject()); // Here I receive the model
requestFormModel and not requestMessageFormModel
setResponsePage(new
RequestMessagePage((RequestMessageFormModel)
this.getForm().getModelObject()));
}
});
}
Remark : The class RequestMessageFormModel is a simple POJO extending
the class CommonFormModel (which is also a POJO). The class
RequestFormModel used by the other page extends CommonFormModel )
Regards,
Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer
*****************************
blog : http://cmoulliard.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]