You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2009/12/04 08:59:20 UTC

[jira] Resolved: (WICKET-2364) CLONE -Make LoadableDetachableModel writable

     [ https://issues.apache.org/jira/browse/WICKET-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2364.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5-M1
                   1.4.4
         Assignee: Igor Vaynberg

after looking at your patch i decided to go with the simpler option of making setobject() work, the alternative adds too much complexity

> CLONE -Make LoadableDetachableModel writable
> --------------------------------------------
>
>                 Key: WICKET-2364
>                 URL: https://issues.apache.org/jira/browse/WICKET-2364
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-RC6
>            Reporter: Michael Mikhulya
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.4, 1.5-M1
>
>         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.