You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2017/01/09 23:21:50 UTC

RadioGroup ajax update

We have a pair od radiobuttons in our html.  They have some html around them,
and so forth.  They are not dynamic.  When the selection changes, we want an
ajax event to make other stuff visible or not.  

		RadioGroup rg = new RadioGroup("rg1");
		rg.add(new Radio("rg1-opt1",new Model("test1")).setOutputMarkupId(true));
		rg.add(new Radio("rg1-opt2",new Model("test2")).setOutputMarkupId(true));
		rg.add(new AjaxFormChoiceComponentUpdatingBehavior() {

			@Override
			protected void onUpdate(AjaxRequestTarget arg0) {
				System.out.println("ajax here!");				
			}

		});
		rg.setMarkupId("rg1");
		rg.setOutputMarkupId(true);
		form.add(rg);

The page renders, but the ajax event never arrives.  The static html has a
ul tag onto which the RadioGroup is mapped, and the two items of the list
are inputs of type radio bound to opt1 and 2.

So question 1, is why aren't we getting the event, and question 2 is are we
using the RadioGroup wrong?  It seems wrong.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-ajax-update-tp4676682.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: RadioGroup ajax update

Posted by Sven Meier <sv...@meiers.net>.
Hi,

that looks good to me.

Please double check that you don't have <wicket:container 
wicket:id="rg1"> and id="rg1" isn't used multiple times in your markup.

Regards
Sven


On 10.01.2017 00:21, Entropy wrote:
> We have a pair od radiobuttons in our html.  They have some html around them,
> and so forth.  They are not dynamic.  When the selection changes, we want an
> ajax event to make other stuff visible or not.
>
> 		RadioGroup rg = new RadioGroup("rg1");
> 		rg.add(new Radio("rg1-opt1",new Model("test1")).setOutputMarkupId(true));
> 		rg.add(new Radio("rg1-opt2",new Model("test2")).setOutputMarkupId(true));
> 		rg.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>
> 			@Override
> 			protected void onUpdate(AjaxRequestTarget arg0) {
> 				System.out.println("ajax here!");				
> 			}
>
> 		});
> 		rg.setMarkupId("rg1");
> 		rg.setOutputMarkupId(true);
> 		form.add(rg);
>
> The page renders, but the ajax event never arrives.  The static html has a
> ul tag onto which the RadioGroup is mapped, and the two items of the list
> are inputs of type radio bound to opt1 and 2.
>
> So question 1, is why aren't we getting the event, and question 2 is are we
> using the RadioGroup wrong?  It seems wrong.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-ajax-update-tp4676682.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org