> You only need models when you have something to display (and possibly
> receive) 

I see..so how would you comment on a component like label (just came across
this example) where you still want to display something but can go ahead
without the usage of model like "add(new Label("message","Hello
World"))"...so one cant just make clear distinction as to where to use a
model where not (i mean i know by looking at the component api one certainly
can determine)..

Thanks again.

Farhan.


> Correct. You typically use CompoundPropertyModels where you want
> display or edit a bunch of properties of an object. Using
> CompoundPropertyModels makes for shorter code.

> Also on your comment on the usage of PropertyModels where you said
> "...when
> you want to
> use IDs that are different from the property expressions you want the
> model
> to work on", i assume that you are refering to a scenario where you are
> using a CompoundPropertyModel but you require the component to be
> populated
> from a different source other than the model set for the parent..e.g.
> add(new RequiredTextField ("login.userName"),new
> PropertyModel(person,"username"));

Yeah. Like with add(new TextField("someRandomComponentId", new
PropertyModel(person, "firstName));

Eelco

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
View this message in context: 
http://www.nabble.com/Wicket-Model---A-very-simple-question-tf4668214.html#a13337090
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to