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.


Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Wicket-user mailing list

Reply via email to