ah, but if you modify a collection that is a model object are you infact
"changing" the object? you are not changing the reference itself but you are
doing something that has sideffects.

eg lets say you have a dropdown choice, but what you want is a collection of
ids not the objects. the easiest way is to have a model in between that
translates a collection of objects to ids and back again. but how to do that
if setobject() is never called?

-igor


On 3/12/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:

If you are not changing the object that is the subject of the model, I
see no reason why setObject should be called.

Eelco

On 3/12/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> actually we are inconsistent in some places and i have been trying to
fix
> it. what we mostly do is whenever we work with a collection we clear it
and
> repopulate it. but we never call setobject() on the model which imho is
> wrong. sometimes i have a model in between that depends on setobject()
> called whenever a property is updated because it does some translation
and
> its a lot easier to proxy a model then it is to proxy a collection. just
my
> 2c.
>
> -igor
>
>
>
> On 3/12/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
> > > > > now all you have to do is
> > > > >
> > > > > LoadableDetachableModel person=new LoadalbeDetachableModel(id);
> > > > > new CheckBox(this, "cb", new PersonCheckBoxModel(person));
> > > > >
> > > > > and everything magically works, hope it gives you some ideas.
> > >
> > > Yes, it does indeed give me many ideas. Right now, I'm trying to
figure
> > > out the implementation details.
> > >
> > > While stepping through the code, I noticed that the setObject()
method
> > > of my IModel never gets called.
> > >
> > > When is this _supposed_ to be set, and why would it not be called in
my
> > > case?
> >
> > There's not always a need for setObject to be called. I haven't read
> > the whole thread, but in the above example, you work on a property
> > ('cb') of the person, so all you have to do (probably) is do something
> > with this updated object (like saving it). You would only do setObject
> > when you would provide a new person, and when the getObject
> > implementation wouldn't take care of that.
> >
> > Personally, I rarely use/ depend on setObject as working with
> > properties of objects is a very typical thing to do.
> >
> > Hope this makes sense,
> >
> > Eelco
> >
> >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to
share
> your
> > opinions on IT & business topics through brief surveys-and earn cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
-------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
your
> opinions on IT & business topics through brief surveys-and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to