<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    soufan

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      22 隨筆 :: 0 文章 :: 0 評論 :: 0 Trackbacks

    如何在BackBean中使用SelectMany 對象?

    Hi.

    This page was made fast and I hope don't be a nuisance to someboby

    首先我們定義backbean來管理我們的 selectMany "list" :

     <managed-bean>
      <managed-bean-name>Manager</managed-bean-name>
     <managed-bean-class>demo.Manager</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
     <managed-bean>
    

    現在Manager類應該有個 SelectMany object來管理信息;

    ?

    package?demo;
    import?javax.faces.component.UISelectMany;
    import?javax.faces.component.UIComponent;

    class?Manager{
    ???
    ????private?UISelectMany?list;
    ???????

    ??????/*
    ???????*?Here?we?must?create?our?list?of?objects
    ???????*?obviously?we?may?add?a?cycle?"while"?or?"for"?
    ???????*?if?we?wouldn't?know?the?number?of?items
    ???????*/?
    ????public?UIComponentBase?getList(){
    ??????
    ?????????list=new?UISelectMany();
    ?????????SelectItem?item?=?new?SelectItem(?"value",?"Description"?);
    ?????????UISelectItem?uiItem?=?new?UISelectItem();
    ?????????uiItem.setValue(?item?);
    ?????????
    ?????????list.getChildren().add(?uiItem?);
    ??????
    ??????return?list;
    ????}

    ????public?void?setList(UIComponentBase?list){
    ????????this.list=(UISelectMany)list;?
    ????}
    ????
    ???public?void?actionListener(ActionEvent?ev){
    ???????
    ???????Object?obj?[]?=?list.getSelectedValues();
    ???????//?obj?is?an?array?of?string?that?contents?the?values?of?our?selectItems
    ???}

    }

    ?

    JSP頁面的代碼如下:?

    <h:selectManyMenu binding="#{Manager.list}">
    

    如果你想使用CheckBox or a ListBox僅僅在JSF文件中該變標簽就可以了.如 <h:selectManyCheckBox> by either <h:selectManyListbox> or <h:selectManyCheckbox>, it is great!!

    posted on 2006-12-19 16:12 soufan 閱讀(330) 評論(0)  編輯  收藏

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


    網站導航:
     
    主站蜘蛛池模板: 亚洲AV无码一区二区二三区入口| 亚洲中文字幕成人在线| 亚洲黄网站wwwwww| 久热免费在线视频| 亚洲国产成人久久精品动漫| 久久精品成人免费看| 亚洲AV第一页国产精品| 99久久精品免费视频| 亚洲一级毛片在线播放| 成年女人毛片免费播放人| 亚洲乱妇老熟女爽到高潮的片| 在线观看免费国产视频| 美女被免费网站视频在线| 国产乱辈通伦影片在线播放亚洲 | 日本免费中文字幕| 亚洲A∨无码无在线观看| 亚洲免费中文字幕| 亚洲人成网站免费播放| 免费h黄肉动漫在线观看| caoporn国产精品免费| 亚洲av日韩av高潮潮喷无码| 免费观看国产网址你懂的| 亚洲精品久久无码| 国产成人高清亚洲| 100部毛片免费全部播放完整| 久久乐国产综合亚洲精品| 免费国产在线观看老王影院| 中文无码成人免费视频在线观看| 亚洲最新黄色网址| 国产伦精品一区二区三区免费迷 | 五月婷婷在线免费观看| 亚洲AV网一区二区三区 | 免费91麻豆精品国产自产在线观看 | 男女污污污超污视频免费在线看| 91视频国产免费| 青青视频免费在线| 亚洲黄色在线播放| 国产jizzjizz视频免费看| 未满十八18禁止免费无码网站| 在线观看亚洲AV日韩A∨| 亚洲精品无码高潮喷水在线|