【发布时间】:2018-05-09 12:27:38
【问题描述】:
我正在尝试使用 radioChoice onChange 从单选表单中获取选定的值,但似乎无法真正找到解决方案。 onEvent 函数被调用,但从这里我不确定如何获取值。
代码:
RadioChoice<String> radioChoice = new RadioChoice<String>("radio", new PropertyModel<String>(this, "selected"),this.radioChoiceList);
radioChoice.add(new AjaxFormComponentUpdatingBehavior("change")
{
@Override
protected void onUpdate(AjaxRequestTarget target)
{
System.out.println("ajax here!");
}
});
Form<?> form = new Form<Void>("form");
add(form);
form.add(radioChoice);
【问题讨论】: