Re: Using non-Model fields in Form
I'm a newbie also but Can't you just create a new model specifically for the RadioChoice component? Each component can have its own model. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using non-Model fields in Form
As Nimmy said you should be able to supply your own model to the RadioChoice which will override the CompoundPropertyModel Assuming NUMBERS is a list... RadioChoiceString rc = new RadioChoiceString(numberRadioChoice, new Model(),NUMBERS); Look at https://cwiki.apache.org/WICKET/working-with-wicket-models.html for more information. nimmy wrote: I'm a newbie also but Can't you just create a new model specifically for the RadioChoice component? Each component can have its own model. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251822.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Using non-Model fields in Form
Sure. When you create an radio choice like: RadioChoiceString rc = new RadioChoiceString(numberRadioChoice, NUMBERS); your are passing the wicket id and a list of choices to the component, but no model. Components without model inherit one from the first parent CompoundPropertyModel based on the child wicket id, in this case: numberRadioChoice. The problem is that the object at the first parament CPM don't have de property numberRa(...), so I guess you missed to provide your own model to the component. On Tue, Feb 1, 2011 at 1:25 PM, nimmy nim_sa...@hotmail.com wrote: I'm a newbie also but Can't you just create a new model specifically for the RadioChoice component? Each component can have its own model. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: Using non-Model fields in Form
This is exactly why I tell folks not to use CPM. People start relying on them too heavily and when all doesn't work as planned, they freak out. It's like the blonde that got locked in her car because the battery died and her automatic locks didn't work. On Tue, Feb 1, 2011 at 10:25 AM, nimmy nim_sa...@hotmail.com wrote: I'm a newbie also but Can't you just create a new model specifically for the RadioChoice component? Each component can have its own model. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org