Person person = new Person();

CompoundPropertyModel personModel = new CompoundPropertyModel(person);
Component parent = new Component("personPanel", personModel);
Component child = new Component("addressPanel", new CompoundPropertyModel(new PropertyModel("address", personModel)));

i dont think this is bloated. the above exact code is sure, but when it plays out in components its not at all. the exact same chain can be created like this in 2.0

Form form=new Form(new CompoundPropertyModel(new Person());

new AddressEditor(form, "address");

the trick in 2.0 is ...
public AddressEditor(parent, id) {
   super(parent, id);
   setmodel(new CompoundPropertyModel(getModel()));
...


so in the above the chain is created for you and works like expected because getModel() in the constructor returns a compoundpropertymodel's "assigned" version that basically works like a property model for the "address" prop. so i dont think this situation is a result of bloated code at all, the compound->property->compound->property will be a common usecase imho.

-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