Yeah but most models do change, right? The thing is, nothing is calling modelChanging(), neither the Form process() nor the form component's updateModel().

So versioning, even if it's on, is not activated. Why is this?

Nathan

Igor Vaynberg wrote:
when a component is versioned and its model is changed it makes a backup of the previous model value by serializing it.

in case of the dataview when you change the sort that change is recorded inside the SortableDataProvider which is the model of the dataview. this causes the dataview to make a clone of the SortableDataProvider which causes the hierarchy to be serialized along with it if it is anonymous. not good.

so you have to be careful. if your model never changes (component uses as read-only) it is ok to use an anonymous class because the model is never serialized. or if you turn off versioning it is also ok.

as far as the dataview is concerned i have been thinking about a fix to solve that problem. it would basically involve separating sorting out of dataprovider. so the sorting bit can be used as a model instead of the whole thing. that would allow one to use an anonymous dataprovider for dataviews. its been on my list for a while, maybe i will move it up a notch or two.

-Igor


On 12/2/05, *Nathan Hamblen* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    This came up before when I was trying to track down why reversing the
    sort order of a DataView was bringing down my test application.
    (http://thread.gmane.org/gmane.comp.java.wicket.user/4309
    <http://thread.gmane.org/gmane.comp.java.wicket.user/4309>) It
    turned out
    that the page versioning code was serializing the entire view hierarchy,
    recursively, because of anonymous model classes that contained pointers
    back into the view.

    The consensus was that you would have to turn off page versioning if
    you
    wanted an anonymous IModel. Is this still the case? I'm just now
    noticing anonymous IModels becoming sort of recommended. Does that mean
    than page versioning is not recommended anymore?

    I'll admit don't even understand how versioning is supposed to work.
    DataView sorting seems to be one of the few things that triggers it.
    I've got forms updating models all over the place and nary a version to
    be seen. So, I just turn it OFF then, and anonymously subclass
    IModel to
    my heart's content?

    Nathan

    Christian Essl wrote:
     > On Thu, 1 Dec 2005 14:24:20 -0500, Andrew Berman
    <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
     > wrote:
     >
     >> Honestly, I don't think there ever was a Spring Integration
    problem.  I
     >> think people were just looking for a cookie-cutter approach to using
     >> Spring
     >> within Wicket.  It's actually quite easy to do without using any
    of the
     >> Spring stuff that Igor and others wrote, but it's always a good
    thing to
     >> have a common approach that everyone can follow.
     >
     > Honestly, I think Igor did a good job: It is just easier and more
     > natural to write over and over again:
     >
     > new HibernateModel(obj,_dao);
     >
     > than
     >
     > new HibernateModel(obj, new Model(){
     >    getObject(Component comp){
     >       return ((MyApplication)Appliation.get()).getDAO();
     >    }
     > });
     >
     > and this is not restricted to HibernateDAOs but to any bean you
    do not
     > want to get serialized whtih your components.
     >
     > Christian
     >
     >
     >
     >
     >
     >
     > ___________________________________________________________
    Gesendet von
     > Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden:
     > http://mail.yahoo.de
     >
     >
     >
     > -------------------------------------------------------
     > This SF.net email is sponsored by: Splunk Inc. Do you grep
    through log
     > files
     > for problems?  Stop!  Download the new AJAX search engine that makes
     > searching your log files as easy as surfing the  web.  DOWNLOAD
    SPLUNK!
     > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
    <http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>



    -------------------------------------------------------
    This SF.net email is sponsored by: Splunk Inc. Do you grep through
    log files
    for problems?  Stop!  Download the new AJAX search engine that makes
    searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
    http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
    <http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
    _______________________________________________
    Wicket-user mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to