use CheckBoxMultipleChoice in wicket

Posted on 2012-06-18 00:07 myfavorite 阅读(318) 评论(0)  编辑  收藏 所属分类: java相关
 1         final CheckBoxMultipleChoice<String> resultlistChoice = new CheckBoxMultipleChoice<String>("resultlist", new PropertyModel<List<String>>(this, "valueList"), new PropertyModel<List<String>>(this, "list"));
 2 
 3         resultlistChoice.add(new AjaxFormComponentUpdatingBehavior("onclick") {
 4 
 5             @Override
 6             protected void onUpdate(AjaxRequestTarget target) {
 7                 // TODO Auto-generated method stub
 8             }
 9         });
10         
11         resultlistChoice.add(new AjaxFormChoiceComponentUpdatingBehavior() {
12             
13             @Override
14             protected void onUpdate(AjaxRequestTarget target) {
15                 // TODO Auto-generated method stub
16                 selectedList.clear();
17                 for (String item : resultlistChoice.getModelObject()) {
18                     selectedList.add(item);
19                     System.out.println(item);
20                 }
21                 target.add(selectedChoice);
22             }
23         });

只有注册用户登录后才能发表评论。


网站导航: