On 4/9/07, Carlos Pita <[EMAIL PROTECTED]> wrote:


1) How can I use a compound property model without naming the nested
form components with their full path (ie. 'birthDate.year' instead of
simply 'year').


use the model luke

what is below is some pseudocode, it is not the best way to do this, but it
will give you an idea.

leave the formcomponentpanel's model null. immediately under it add a
webmarkupcontainer with the following model

class indentingmodel extends Model implements icomponentinheritedmodel {
iwrapmodel wraponinheritance(Component c) {
return new PropertyModel(FormComponentPanel.this.getModel(),
FormComponentPanel.this.getId()+"."+c.getId());
}
}

add all the children to this webmarkupcontainer instead of directly to the
panel. what this model does is any children created without a model will
inherit a model that looks up the property that is prefixed with the
formcomponentpanel's id.

-igor
-------------------------------------------------------------------------
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