Hi,

You use it like this:

(assuming myModel is the compound property model)

Label idLabel = new Label("idLabel", myModel.bind("id"));

This would  give component  id "idLabel", using property "id".

CompoundPropertyModel.bind() basically returns a PropertyModel.


iainr


Manuel Corrales wrote:
Ok, I have found a few things but still can't figure this out. Apparently
the BoundCompoundPropertyModel is what i need, but it is deprecated. And I
have read the javadoc but still can't figure out how to achieve having
wicket:id on HTML different than the property name in the model. The javadoc
mentions CompoundPropertyModel bind method, but can't figure out how to use
it.
Any help?

Thanks!

On Tue, Oct 20, 2009 at 3:57 PM, Manuel Corrales
<manuelcorra...@gmail.com>wrote:

Hello. I have a (i hope) reusable panel. This panel has a textField, a
hiddenField and a link that open up a modalWindow. Then you can select an
item from a list in the modal window and the field and hidden field
completes according to the selected value. I want the hidden field to be
"binded" with a property of the model I am using in a form (using
CompoundPropertyModel). I intend to use this panel in several forms in my
application, the problem I have is that the field name of the model object
is different on every form, and the wicket:id is the same (because it is the
same hiddenField).
How can I solve this? Is there a way of having a wicket:id with a different
name than a model property name?

Please ask for anything you need to help me, I don't know if I was clear on
my problem.

Thanks in advance!
Manuel.



Reply via email to