gpt4 book ai didi

java - Wicket 框架 DropDownChoice

转载 作者:行者123 更新时间:2023-12-01 06:56:58 26 4
gpt4 key购买 nike

我试图在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com