[
https://issues.apache.org/jira/browse/WICKET-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Mikhulya updated WICKET-2364:
-------------------------------------
Attachment: LoadableDetachableModel.java.patch
I changed style to follow one used in Wicket project.
And created a _patch_ to make review easier.
Also one issue is fixed and javadocs are improved.
> CLONE -Make LoadableDetachableModel writable
> --------------------------------------------
>
> Key: WICKET-2364
> URL: https://issues.apache.org/jira/browse/WICKET-2364
> Project: Wicket
> Issue Type: Improvement
> Reporter: Michael Mikhulya
> Attachments: LoadableDetachableModel.java.patch
>
>
> 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.