Sealyu

          --- 博客已遷移至: http://www.sealyu.com/blog

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
            618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks
          使用<f:selectItems value="#{itemTypeList}" />實現(xiàn)下拉列表時,報錯:
          Expected a child component type of UISelectItem/UISelectItems for component type javax.faces.SelectOne(typeFilter). Found org.jboss.seam.jsf.ListDataModel.
          其中itemTypeList是action中定義的一個Datamodal。
          錯誤原因,f:selectItems引用的是一個static的List,還不能是ArrayList,
          解決方法:
          1.使用seam自帶標(biāo)簽 s:selectedItems
          2.將后臺的列表設(shè)置為靜態(tài)。

          附:標(biāo)簽說明

          <s:selectItems>

          Description

          Creates a List<SelectItem> from a List, Set, DataModel or Array.

          Attributes

          Usage


          <h:selectOneMenu value="#{person.age}" 

                           converter="ageConverter">

            <s:selectItems value="#{ages}" var="age" label="#{age}" />

          </h:selectOneMenu>


          posted on 2009-03-10 16:14 seal 閱讀(2449) 評論(0)  編輯  收藏 所屬分類: Seam
          主站蜘蛛池模板: 资中县| 耿马| 房产| 时尚| 盘山县| 定兴县| 刚察县| 依兰县| 恩施市| 辽源市| 西昌市| 镇远县| 天津市| 安平县| 隆尧县| 牡丹江市| 资兴市| 都匀市| 新安县| 商城县| 五常市| 阿瓦提县| 夏津县| 荥经县| 永城市| 抚顺县| 剑河县| 灌南县| 西贡区| 崇州市| 永春县| 田林县| 荃湾区| 临沭县| 洱源县| 玉龙| 洮南市| 义乌市| 栖霞市| 安新县| 怀安县|