use CheckBoxMultipleChoice in wicket

          Posted on 2012-06-18 00:07 myfavorite 閱讀(335) 評論(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         });

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 吉首市| 牟定县| 台州市| 九龙县| 元朗区| 伊宁县| 毕节市| 曲周县| 喜德县| 北辰区| 岑溪市| 水富县| 右玉县| 鄂温| 磴口县| 沭阳县| 湘乡市| 潼南县| 蒲城县| 镇巴县| 陇西县| 察隅县| 合阳县| 宜都市| 汝南县| 乌拉特前旗| 白沙| 定西市| 开化县| 自贡市| 江源县| 凌海市| 东乌| 永顺县| 元氏县| 鄂州市| 辛集市| 乌兰浩特市| 定日县| 贡山| 沭阳县|