But one question: the Javadoc says that the BoundCompoundPropertyModel uses the name (I understand here as the id) of a component as the property name it should use to set value on model.
So, I understand as:
add(new TextField("name", new BoundCompountPropertyModel(userBean)));
or...
add(new TextField("name", new CompountPropertyModel(userBean, "name")));
Am I right?
On 5/4/06, Igor Vaynberg <
[EMAIL PROTECTED]> wrote:
what you want is a CompoundPropertyModel not the bound variant.
there is a searchbox on our wiki :)
http://www.wicket-wiki.org.uk/wiki/index.php/Models
-IgorOn 5/4/06, Bruno Borges <[EMAIL PROTECTED]> wrote:Isn't this code correct?class UserForm extends Form {User user = new User(); // POJO Bean<constructor> {}...}
BoundCompoundPropertyModel model = new BoundCompoundPropertyModel(user);
add(new TextField("name", model));
add(new TextField("email", model)); // Can I do this? Use the same model object for different properties?
<on submit> {String name = user.getName ();}
// Why name is still null ?
Am I missing something here? Where in the docs has some reference for Property Models ?
--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
--
Bruno Borges
[EMAIL PROTECTED]
Sun Certified Java Programmer for 1.4
Sun Certified Web Component Developer for 1.4
