Martin Makundi wrote:
>
> Please give me an example:
>
Would the following work for you? It uses a combination of
CompoundPropertyModel and setObjectModel.
class Address {
public String getStreet()...
public void setStreet(String street)...
public String getCity()...
public void setCity(String city)...
}
Form form1 = new Form("form1");
form1.setOutputMarkupId(true);
form1.setModel(new CompoundPropertyModel(someService.getAddress()));
TextField street = new TextField("street");
form1.add(street);
TextField city = new TextField("city");
form1.add(city);
AjaxButton submit = new AjaxButton("submit") {
@Override
protected void onSubmit(AjaxRequestTarget tgt, Form form) {
Address address = (Address)form.getModelObject();
someService.updateAddress(address);
form.setModelObject(someService.getAddress());
tgt.addComponent(form);
};
};
form1.add(submit);
add(form1);
--
View this message in context:
http://www.nabble.com/Updating-multiple-PropertyModels-tp16944966p16993026.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]