RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at com.route1.mobi.map3.web.panels.PhoneNumberPanel$2.onEvent(PhoneNumberPanel.java:125) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:288) at
RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at
RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
right. see AjaxFormChoiceComponentUpdatingBehavior -igor On Thu, Mar 20, 2008 at 10:02 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get
RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
I added the AjaxFormChoiceComponentUpdatingBehavior to Radio objects and I got a runtime exception (can only be added to...), then I added it to the RadioGroup and nothing happens when I change the selection! -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:07 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel right. see AjaxFormChoiceComponentUpdatingBehavior -igor On Thu, Mar 20, 2008 at 10:02 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) {
RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
OK, now I changed my code to this: add(nanp = new RadioChoice(nanp, new PropertyModel(this, phoneNumber.nanp), Arrays.asList(new String[] { true, false }))); nanp.add(new AjaxFormComponentUpdatingBehavior(onclick) { private static final long serialVersionUID = -1406454064553153207L; @Override protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); What I don't understand is that when I click on a radio button and onUpdate() gets called, RadioChoice.convertedInput is null. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:17 PM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel I added the AjaxFormChoiceComponentUpdatingBehavior to Radio objects and I got a runtime exception (can only be added to...), then I added it to the RadioGroup and nothing happens when I change the selection! -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:07 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel right. see AjaxFormChoiceComponentUpdatingBehavior -igor On Thu, Mar 20, 2008 at 10:02 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
in onupdate you should be calling getmodelobject() -igor On Thu, Mar 20, 2008 at 10:55 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: OK, now I changed my code to this: add(nanp = new RadioChoice(nanp, new PropertyModel(this, phoneNumber.nanp), Arrays.asList(new String[] { true, false }))); nanp.add(new AjaxFormComponentUpdatingBehavior(onclick) { private static final long serialVersionUID = -1406454064553153207L; @Override protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); What I don't understand is that when I click on a radio button and onUpdate() gets called, RadioChoice.convertedInput is null. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:17 PM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel I added the AjaxFormChoiceComponentUpdatingBehavior to Radio objects and I got a runtime exception (can only be added to...), then I added it to the RadioGroup and nothing happens when I change the selection! -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:07 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel right. see AjaxFormChoiceComponentUpdatingBehavior -igor On Thu, Mar 20, 2008 at 10:02 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
there is also a bug report in jira for formchoice..behavior, see if that affects you... -igor On Thu, Mar 20, 2008 at 11:08 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: in onupdate you should be calling getmodelobject() -igor On Thu, Mar 20, 2008 at 10:55 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: OK, now I changed my code to this: add(nanp = new RadioChoice(nanp, new PropertyModel(this, phoneNumber.nanp), Arrays.asList(new String[] { true, false }))); nanp.add(new AjaxFormComponentUpdatingBehavior(onclick) { private static final long serialVersionUID = -1406454064553153207L; @Override protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); What I don't understand is that when I click on a radio button and onUpdate() gets called, RadioChoice.convertedInput is null. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:17 PM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel I added the AjaxFormChoiceComponentUpdatingBehavior to Radio objects and I got a runtime exception (can only be added to...), then I added it to the RadioGroup and nothing happens when I change the selection! -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:07 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel right. see AjaxFormChoiceComponentUpdatingBehavior -igor On Thu, Mar 20, 2008 at 10:02 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: I'm adding AjaxFormComponentUpdatingBehavior to RadioGroup. If I add it to Radio I get a runtime exception that says AjaxFormComponentUpdatingBehavior can only be added to a FormComponent. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 12:59 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel are you adding the bheavior to Radio or RadioGroup, it needs to go to Radio components -igor On Thu, Mar 20, 2008 at 6:21 AM, Zhubin Salehi [EMAIL PROTECTED] wrote: Ok, I noticed when I use AjaxFormComponentUpdatingBehavior, no JavaScript gets added to radio buttons. -Original Message- From: Zhubin Salehi [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 9:18 AM To: users@wicket.apache.org Subject: RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel onclick doesn't work either. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2008 1:56 AM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode);
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at com.route1.mobi.map3.web.panels.PhoneNumberPanel$2.onEvent(PhoneNumberPanel.java:125) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at
RE: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at com.route1.mobi.map3.web.panels.PhoneNumberPanel$2.onEvent(PhoneNumberPanel.java:125) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at com.route1.mobi.map3.web.panels.PhoneNumberPanel$2.onEvent(PhoneNumberPanel.java:125) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1330) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:358) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel
also, for what its worth, onclick works a lot better for this sort of thing when dealing with check/readio html components -igor On Wed, Mar 19, 2008 at 10:55 PM, Igor Vaynberg [EMAIL PROTECTED] wrote: i dont think browsers support an onschange event :) -igor On Wed, Mar 19, 2008 at 7:24 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: So now I wrote this code: nanp.add(new Radio(nanpTrue, new Model(new Boolean(true; nanp.add(new Radio(nanpFalse, new Model(new Boolean(false; nanp.add(new AjaxFormComponentUpdatingBehavior(onschange) { private static final long serialVersionUID = -1406454064553153207L; protected void onUpdate(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } }); But onUpdate() method is not called when I change selection. What should I do? Thanks, Zhubin -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2008 6:04 PM To: users@wicket.apache.org Subject: Re: Problem with using RadioGorup and AjaxEventBehavior in a FormComponentPanel ajax event behavior does not send over input. try ajaxformcomponentupdatingbehavior. -igor On Wed, Mar 19, 2008 at 2:19 PM, Zhubin Salehi [EMAIL PROTECTED] wrote: Hi all, I'm trying to update some TextFields in a FormComponentPanel when the user selects a radio button from a RadioGroup. Here is a fragment of my code that created Radio and RadioGroup objects: add(nanp = new RadioGroup(nanp, new PropertyModel(this, phoneNumber.nanp))); nanp.add(new Radio(nanpTrue, new Model(new Boolean(true))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = -1406454064553153207L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); nanp.add(new Radio(nanpFalse, new Model(new Boolean(false))).add(new AjaxEventBehavior(onchange) { private static final long serialVersionUID = 6475950784724594836L; protected void onEvent(AjaxRequestTarget target) { nanp.processInput(); target.addComponent(areaCode); target.addComponent(countryDialingCode); target.addComponent(routingDialingCode); } })); The problem is that as soon as I click on one of the radio buttons, I get the following exception: WicketMessage: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] Root cause: org.apache.wicket.util.convert.ConversionException: Can't convert null value to a primitive class: boolean for setting it on [EMAIL PROTECTED] at org.apache.wicket.util.lang.PropertyResolver$MethodGetAndSet.setValue(PropertyResolver.java:1079) at org.apache.wicket.util.lang.PropertyResolver$ObjectAndGetSetter.setValue(PropertyResolver.java:576) at org.apache.wicket.util.lang.PropertyResolver.setValue(PropertyResolver.java:130) at org.apache.wicket.model.AbstractPropertyModel.setObject(AbstractPropertyModel.java:164) at org.apache.wicket.Component.setModelObject(Component.java:2880) at org.apache.wicket.markup.html.form.FormComponent.updateModel(FormComponent.java:1052) at org.apache.wicket.markup.html.form.FormComponent.processInput(FormComponent.java:934) at com.route1.mobi.map3.web.panels.PhoneNumberPanel$2.onEvent(PhoneNumberPanel.java:125) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:161) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:288) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:100) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166)