The idea is that you set a Compound/BoundCompoundPropertyModel on the
parent (or further up the hierarchy) of these components.

setModel(new (Bound)CompoundPropertyModel(userBean));
add(new TextField("name"));

Bound and the normal CompoundPropertyModel do not differ much from
each other, except that the Bound variant *additionally* gives you the
option of binding to another property of the component id. That's
handy when you have say 10 components to add, and just one of them has
a property name that differs from the component id you want to use. In
that case, you would do:

BoundCompoundPropertyModel m = new BoundCompoundPropertyModel(userBean);
setModel(m);
TextField t = new TextField("someid");
add(t);
m.bind(t, "name");

The equivilant of what you want without these types of models is the
plain property model:

add(new TextField("someid", new PropertyModel(userBean, "name"));



Eelco


 So, I understand as:

add(new TextField("name", new
BoundCompountPropertyModel(userBean)));

or...

add(new TextField("name", new CompountPropertyModel(userBean, "name")));

Am I right?



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to