Re: Model property name different than wicket:id, is possible?
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.comwrote: 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.
Re: Model property name different than wicket:id, is possible?
Do you have to use CompoundPropertyModel? Why not use explicit models instead? This is one reason why I don't like to use CompoundPropertyModels. On Tue, Oct 20, 2009 at 2: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. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Model property name different than wicket:id, is possible?
Hey, thanks!! I solved the issue using Iain advice. Thanks for your help! Best regards. On Wed, Oct 21, 2009 at 9:15 AM, James Carman jcar...@carmanconsulting.comwrote: Do you have to use CompoundPropertyModel? Why not use explicit models instead? This is one reason why I don't like to use CompoundPropertyModels. On Tue, Oct 20, 2009 at 2: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. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Model property name different than wicket:id, is possible?
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.
Re: Model property name different than wicket:id, is possible?
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.comwrote: 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.
Re: Model property name different than wicket:id, is possible?
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 you has: public class ObjectThatGoesToModel{ private Object propetyThatGoesToSomeForm; private Object propetyThatGoesToOtherFormInSomeSituations; } ?? I think you can use new PropertyModel(compondedPropertyModel, propetyThatGoesToSomeForm) or new PropertyModel(compondedPropertyModel, propetyThatGoesToOtherFormInSomeSituations) On Tue, Oct 20, 2009 at 4:57 PM, Manuel Corrales manuelcorra...@gmail.comwrote: 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. -- Pedro Henrique Oliveira dos Santos