simple radiogroup with true/false and a propertymodel
Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/ false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn //td td class=iteminput type=radio wicket:id=requestsOff //td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/Off cheers, Steve smime.p7s Description: S/MIME cryptographic signature
Re: simple radiogroup with true/false and a propertymodel
did you add emailRequests to the form or somewhere under? -igor On Mon, Feb 16, 2009 at 8:12 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn //td td class=iteminput type=radio wicket:id=requestsOff //td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/Off cheers, Steve - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: simple radiogroup with true/false and a propertymodel
yeah its added and it renders and everything seems to work except its not setting any data. cheers, steve On 16/02/2009, at 5:21 PM, Igor Vaynberg wrote: did you add emailRequests to the form or somewhere under? -igor On Mon, Feb 16, 2009 at 8:12 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn //td td class=iteminput type=radio wicket:id=requestsOff //td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/Off cheers, Steve - 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
Re: simple radiogroup with true/false and a propertymodel
ive used that exact usecase dozens of times, quickstart please -igor On Mon, Feb 16, 2009 at 10:01 AM, Stephen Swinsburg s.swinsb...@lancaster.ac.uk wrote: yeah its added and it renders and everything seems to work except its not setting any data. cheers, steve On 16/02/2009, at 5:21 PM, Igor Vaynberg wrote: did you add emailRequests to the form or somewhere under? -igor On Mon, Feb 16, 2009 at 8:12 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn //td td class=iteminput type=radio wicket:id=requestsOff //td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/Off cheers, Steve - 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: simple radiogroup with true/false and a propertymodel
will do in the next few days. thanks igor. cheers, Steve On 16/02/2009, at 6:10 PM, Igor Vaynberg wrote: ive used that exact usecase dozens of times, quickstart please -igor On Mon, Feb 16, 2009 at 10:01 AM, Stephen Swinsburg s.swinsb...@lancaster.ac.uk wrote: yeah its added and it renders and everything seems to work except its not setting any data. cheers, steve On 16/02/2009, at 5:21 PM, Igor Vaynberg wrote: did you add emailRequests to the form or somewhere under? -igor On Mon, Feb 16, 2009 at 8:12 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn //td td class=iteminput type=radio wicket:id=requestsOff // td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/Off cheers, Steve - 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 - 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
Re: simple radiogroup with true/false and a propertymodel
quickstart checked out ok via: CompoundPropertyModel testModel = new CompoundPropertyModel(testObject); Form form = new Form(form, testModel); RadioGroup groupOne = new RadioGroup(groupOne, new PropertyModel(testModel, paramOne)); groupOne.add(new Radio(on, new Model(new Boolean(true; groupOne.add(new Radio(off, new Model(new Boolean(false; form.add(groupOne); and in the onSubmit() TestObject testObject = (TestObject) form.getModelObject(); System.out.println(one: + testObject.isParamOne()); was alternating between true/false. Must be somewhere in my real onSubmit. Good to know my code was right though ;) cheers, Steve On 16/02/2009, at 6:18 PM, Stephen Swinsburg wrote: will do in the next few days. thanks igor. cheers, Steve On 16/02/2009, at 6:10 PM, Igor Vaynberg wrote: ive used that exact usecase dozens of times, quickstart please -igor On Mon, Feb 16, 2009 at 10:01 AM, Stephen Swinsburg s.swinsb...@lancaster.ac.uk wrote: yeah its added and it renders and everything seems to work except its not setting any data. cheers, steve On 16/02/2009, at 5:21 PM, Igor Vaynberg wrote: did you add emailRequests to the form or somewhere under? -igor On Mon, Feb 16, 2009 at 8:12 AM, Steve Swinsburg s.swinsb...@lancaster.ac.uk wrote: Hi all, I can't figure out how the RadioGroup component works in Wicket My use case is this. I have a bunch of parameters which I need a true/false answer for. So each group of choices (true or false) will map to a boolean parameter in my PropertyModel. What is wrong with this code: CompoundPropertyModel preferencesModel = new CompoundPropertyModel(profilePreferences); Form form = new Form(form, preferencesModel); RadioGroup emailRequests = new RadioGroup(emailRequestsEnabledGroup, new PropertyModel(preferencesModel, emailRequestsEnabled)); emailRequests.add(new Radio(requestsOn, new Model(true))); emailRequests.add(new Radio(requestsOff, new Model(false))); and markup: tr wicket:id=emailRequestsEnabledGroup td class=iteminput type=radio wicket:id=requestsOn // td td class=iteminput type=radio wicket:id=requestsOff // td /tr In my onSubmit I just get the modelObject and save it as I do with other forms. I was hoping that the boolean parameter in that object would be set to true/false depending on the radio button. It's not being set at all though. An example of what I want to do is illustrated by the Facebook Settings Notifications page where it has a bunch of radiobuttons with On/ Off cheers, Steve - 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 - 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