CLONE -Make LoadableDetachableModel writable
--------------------------------------------
Key: WICKET-2364
URL: https://issues.apache.org/jira/browse/WICKET-2364
Project: Wicket
Issue Type: Improvement
Reporter: Michael Mikhulya
To keep it compatible with current usage:
public final void setObject(Object obj) {
reload(obj);
tempModelObject = obj;
}
protected void reload(Object obj) {
throw new OperationNotSupportedException("Read only model");
}
Subclasses can now implement their own write logic. This is necessary for for
instance stand alone dropdownchoice components that need to store their
selection.
e.g.
MyPage {
IModel<SchoolYear> selectedSchoolYear;
public MyPage() {
selectedSchoolYear = new
HibernateModel<SchoolYear>(SchoolYear.current());
new SchoolYearDropDownChoice(this, "schoolyear", selectedSchoolYear);
}
}
If HibernateModel is not writeable then the selected SchoolYear instance would
end up in the session.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.