I find it helps to think about wicket's Imodel hirarchy as model-locators.
These classes exist to help the components locate your actual model objects.
I always thought imodel was a bit of a misnomer. Hope this helps.

-Igor
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Eelco Hillenius
> Sent: Tuesday, August 23, 2005 1:20 PM
> To: [email protected]
> Subject: Re: [Wicket-user] Question about DropDownChoice
> 
> Did you read http://wicket.sourceforge.net/wiki/index.php/Newuserguide
> and http://wicket.sourceforge.net/wiki/index.php/Models ?
> 
> IModel is the base of all models. getObject(Component) and 
> setObject(Component, Object) can be implemented any way you 
> want. The Component argument is there to let you do things 
> like we do with ComponendPropertyModel (which is, using the 
> component's id as an Ognl expression). Models are detached by 
> default (IDetachable), but this does nothing for basic 
> models. Model implementations that have Detachable in them, 
> do have the ability to /attach/ too. This is implemented in 
> the models themselves; the only thing Wicket does from the 
> outside is calling detach at the end of a request cycle. 
> Again, you can basically do anything you want with this 
> attach/detach behaviour.
> 
> Hope this helps. If not, maybe you could give us some 
> specific things you want to accomplish.
> 
> Eelco
> 
> 
> On 8/23/05, Gregg D Bolinger <[EMAIL PROTECTED]> wrote:
> > Eelco,
> > 
> > I've been scanning the wiki since you posted this and I just am not 
> > able to get a grasp from the doucmentation on Models in Wicket for 
> > what I want to do.  Can you explain a bit on how I would use the 
> > IModel interface to achieve what I want?  Thanks.
> > 
> > Gregg
> > 
> > 
> > On 8/22/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > 
> > > True, It is not nescesarily a problem. Depends on where you store 
> > > it, and keep in mind that if you're doing session clustering, the 
> > > whole list would have to be serialized too, while this is not the 
> > > case for detachable models. Also, by using detachable models, you 
> > > can avoid having problems with e.g. lazy loading relations in 
> > > Hibernate (for which you need the current session, which 
> is closed 
> > > after your current session, etc). The /advantage/ of 
> plain lists is 
> > > that they are easier to work with, and if they don't change much, 
> > > that's more efficiently than re-getting them all the time.
> > > 
> > > Eelco
> > > 
> > > On 8/23/05, Gregg D Bolinger <[EMAIL PROTECTED]> wrote: 
> > > > Could you explain a bit on why having that list in 
> memory is bad 
> > > > if it's dynamic data?  If the page is loaded the first 
> time and it 
> > > > grabs
> > information
> > > > from, say, a database, then the next time that page is 
> requested, 
> > > > would
> > it
> > > > not go fetch from the database again?  I'd assume that I am 
> > > > lacking on
> > my
> > > > understanding of the framework's lifecycle and how it deals with
> > requests.
> > > >
> > > >  Gregg
> > > >
> > > >
> > > > On 8/22/05, Eelco Hillenius < [EMAIL PROTECTED]> wrote:
> > > > >
> > > > > The simplest would be not to use the ChoiceRenderer, 
> but depend 
> > > > > on your object's toString instead. But that's usually too 
> > > > > simple, so probably not the best way. Furthermore, 
> using a list 
> > > > > is convenient and works if you have no problem with 
> having that 
> > > > > list in memory. If that's a dynamic list, that 
> probably not what 
> > > > > you want, in which case you would be better of using 
> the IModel argument.
> > > > >
> > > > > Eelco
> > > > >
> > > > >
> > > > > On 8/23/05, Gregg D Bolinger <[EMAIL PROTECTED] > wrote:
> > > > > > Currently, via searching the mailing list, I am 
> populating a 
> > > > > > drop
> > down
> > > > list
> > > > > > like this.
> > > > > >
> > > > > >  categoryChoice = new DropDownChoice("category", list, new 
> > > > > > ChoiceRenderer("category", "categoryId"));
> > > > > >
> > > > > >  Where list is a java.util.List full of Category 
> objects which 
> > > > > > is a
> > POJO
> > > > > > consiting of the (Integer)categoryId and the 
> (String)category. 
> > > > > >
> > > > > >  This works.  My question is, since I saw multiple ways of 
> > > > > > doing
> > this
> > > > and
> > > > > > this appeared to be the simplest, is it
> > > > > >
> > > > > >  a) really the simplest
> > > > > >  b) the best way
> > > > > >  c) none of the above
> > > > > >  d) all of the above.
> > > > > >
> > > > > >  Thanks for any suggestions.
> > > > > >
> > > > > >  Gregg
> > > > > >
> > > > >
> > > > >
> > > > >
> > -------------------------------------------------------
> > > > > SF.Net email is Sponsored by the Better Software Conference & 
> > > > > EXPO September 19-22, 2005 * San Francisco, CA * Development 
> > > > > Lifecycle
> > > > Practices
> > > > > Agile & Plan-Driven Development * Managing Projects & Teams * 
> > > > > Testing
> > & QA
> > > > > Security * Process Improvement & Measurement *
> > http://www.sqe.com/bsce5sf
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > [email protected]
> > > > >
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > >
> > > >
> > > 
> > > 
> > > -------------------------------------------------------
> > > SF.Net email is Sponsored by the Better Software 
> Conference & EXPO 
> > > September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> > Practices
> > > Agile & Plan-Driven Development * Managing Projects & Teams * 
> > > Testing & QA Security * Process Improvement & Measurement * 
> > > http://www.sqe.com/bsce5sf 
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > 
> > 
> >
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & 
> EXPO September 19-22, 2005 * San Francisco, CA * Development 
> Lifecycle Practices Agile & Plan-Driven Development * 
> Managing Projects & Teams * Testing & QA Security * Process 
> Improvement & Measurement * http://www.sqe.com/bsce5sf 
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 
> 
> 




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to