On 7/2/05, Ralf Ebert <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> > You're right that ListItems are generated (populated) for each
> > request, but the underlying model of ListView (a List) and thus the
> > ListItems models (specific item of the List) stays the same. And the
> > model is where you keep your state.
> hmm, I think this is a bit different from other Wicket components,
> because as long as you're not using a list, the components itself
> have a state and not only the model of the component. So I can call
> setCaption on a label and I still have this caption the next request.

Sorry, not sure I understand what you mean. A Label has a model and
the model value gets displayed. I guess the model value ist what you
call the Caption?

> But when calling setCaption on a label in a list, this is not
> available in the next request because the items got re-populated. Why
> not offering a possibility to reuse the components which have been
> generated in the last request cycle? I thought it's ok to encapsulate
> this kind of view related state information in the component class
> itself and use the model only for the real model data not related to
> view details?

you could do it, but than you loose all the benefit of the different
Model types.

> For my example (just to make sure I got the idea), I would have a
> model object containing the business data model object and an
> additional boolean property for saving the collapsed state so when
> the list is populated I can set the visibility?

your model object can be any class, not just simple String. May I
suggest you read http://wicket.sourceforge.net/wiki/index.php/Models.

Juergen


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to