The following code works (have unit tests) but I would appreciate a code
review from someone.
Legend
MyPojo - bean backing up form
MyProperty - another POJO that is property of MyPojo (MyPojo has field
'myProperty' of type MyProperty)
MyFormComponent - custom form component that displays/manipulates MyProperty
(myProperty == myFormComponent.getModelObject())
In particular, I want to ensure that when MyComponent's modelObject is
updated, so is formBean's property (to be more precise, that the two
reference the same object)
//inside page:
IModel formModel = new CompoundPropertyModel(MyPojo);
Form form = new Form("form", formModel);
page.add(form);
MyFormComponent myComp = new MyFormComponent("myProperty", new
PropertyModel(formModel, "myProperty"));
form.add(myComp);
and constructor:
MyFormComponent(wicketId, model)
{
super(wicketId, model);
}
-----
----------------
Nikita Tovstoles
vside.com
----------------
--
View this message in context:
http://www.nabble.com/please-review-my-CompoundPropertyModel-use-tp19868935p19868935.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]