> Appreciate the quick follow up, so would it be OK to assume that every
> page-component has to have a Model associated with it,

You only need models when you have something to display (and possibly
receive) and use components that use models (which is the case for
most components we ship, but doesn't always have to be the case).

> either the model is
> individually explicitly tagged with a component e.g. "add(new
> RequiredTextField("dateOfBirth", new PropertyModel(person, "dateOfBirth")))"
> OR it using the model configured for its parent (which lets say could be the
> form or the page) via CompoundPropertyModel where you normally don't require
> using the PropertyModel unless the need comes (as you commented, though i
> have some question below on it)....Correct ?

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]

Reply via email to