开发者

How do you get the selected items in a Wicket ListMultipleChoice?

开发者 https://www.devze.com 2023-01-03 09:31 出处:网络
I\'m using a ListMultipleChoice component in wicket and I want to get the selected items.It seems that isSelected is protected so I cannot use it.How do I get the selected开发者_运维知识库 items?You m

I'm using a ListMultipleChoice component in wicket and I want to get the selected items. It seems that isSelected is protected so I cannot use it. How do I get the selected开发者_运维知识库 items?


You must bind your list with data and ListMultipleChoice as in Example

public MyForm(String id, IModel model, IFeedback feedback) {
    List choices = new ArrayList();
    choices.add("foo");
    choices.add("bar");
    MultiListChoice lc = new MultiListChoice("myMultiListChoice", new PropertyModel(model, "foobarList"), choices);
    add(lc);
    ...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号