我试图在 wicket 框架中获取 dropdownchoice 的选定值,但我无法获取它。 如何在 dropdownchoice 的更改事件上获取 DropDownChoice 的选定值??? 谢谢。 我
最佳答案
这很简单,您所要做的就是使用 AjaxFormComponentUpdatingBehavior
:
DropDownChoice<String> ddc = new DropDownChoice<String>("ddc", model, Arrays.asList("a", "b", "c"));
ddc.add(new AjaxFormComponentUpdatingBehavior("onchange") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
System.out.println("selected: " + model.getObject());
}
});
关于java - Wicket 框架 DropDownChoice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9581367/