ignore this - some jquery I had was breaking the wicket javascript.
On Sat, May 21, 2011 at 8:16 PM, Tom Howe <[email protected]> wrote:
> Hi,
> Hi,
> I am trying to build a RadioGroup that triggers an ajax callback so I can
> refresh another panel with the value set in the radio.
>
> I couldn't find a good example anywhere and I've failed using the
> AjaxFormChoiceComponentUpdatingBehavior
> in the following code.
>
> What am I doing wrong here.. or is not supported?
>
> Thanks, Tom
>
>
> 1. final RadioGroup<String> imageChoice = new
> RadioGroup<String>("imageChoice", new Model<String>(chosen) );
> 2.
> 3. imageChoice.setOutputMarkupId( true );
> 4. imageChoice.add( new
> AjaxFormChoiceComponentUpdatingBehavior(){
> 5. private static final long serialVersionUID = 1L;
> 6.
> 7. @Override
> 8. protected void onUpdate(AjaxRequestTarget target) {
> 9. log.info("updated radio");
> 10. }
> 11.
> 12. });
> 13.
> 14.
> 15. ListView<String> images = new
> ListView<String>("imageList", imageModel) {
> 16.
> 17. @Override
> 18. protected void populateItem(ListItem listItem) {
> 19.
> 20. Radio radioChoice = new Radio("radio",
> listItem.getModel(), imageChoice);
> 21.
> 22. listItem.add(radioChoice);
> 23.
> 24. }
> 25. };
> 26. imageChoice.add(images);
> 27.
> 28. add(imageChoice);
> 29.
> 30. }
>
>