Thank you Tong, interesting approach. I make it work for me by adding AjaxFormSubmitingBehavior to the Radio component, just to keep in synch the model with the RadioGroup state. But your solution is more elegant.
Kent Tong wrote: > > Alex Objelean <alexandru.objelean <at> isdc.ro> writes: > >> Thank you Jan! Sad thing is that 1.2.x branch will never support this >> feature. > > Try: > > Form f = ...; > RadioGroup rg2 = new RadioGroup("rg2", ...); > rg2.setOutputMarkupId(true); > setupAjaxRadio(f, rg2, new Radio("r3", new Model("abc"))); > setupAjaxRadio(f, rg2, new Radio("r4", new Model("def"))); > ... > > private void setupAjaxRadio(final Form form, > final RadioGroup radioGroup, > final Radio radio) { > radioGroup.add(radio.add(new AjaxEventBehavior("onchange") { > protected void onEvent(AjaxRequestTarget target) { > radioGroup.processInput(); > target.addComponent(form); > } > protected CharSequence getEventHandler() { > return getCallbackScript(new AppendingStringBuffer( > "wicketAjaxPost('").append(getCallbackUrl()).append( > "', wicketSerialize(document.getElementById('" > + radio.getMarkupId() + "'))"), null, null); > } > > })); > } > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Wicket-user mailing list > Wicket-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wicket-user > > -- View this message in context: http://www.nabble.com/-Question--wicket.markup.html.form.Radio-tf3926549.html#a11161363 Sent from the Wicket - User mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user