Sealyu

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

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  618 随笔 :: 87 文章 :: 225 评论 :: 0 Trackbacks
使用<f:selectItems value="#{itemTypeList}" />实现下拉列表时,报错:
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自带标签 s:selectedItems
2.将后台的列表设置为静态。

附:标签说明

<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 阅读(2413) 评论(0)  编辑  收藏 所属分类: Seam

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


网站导航: