[英]JSF Trinidad selectOneChoice UI COmponent
這是我的.xhtml文件
<tr:selectOneChoice >
<f:selectItems value="#{bean.items}"/>
</tr:selectOneChoice>
我希望能夠在客戶端的不同選項之間進行標識。 在我的后備豆中,每個選擇都有布爾值。
是否可以在客戶端中在這些選項之間進行實際標識?
Bean代碼如下所示:
public List<SelectItem> getItems(Menu menu) {
List<SelectItem> list = new ArrayList();
SelectItem selectItem = new SelectItem(new MyObj("some string",false), "label");
list.add(selectItem);
return list;
}
MyObj類包含我希望能夠在客戶端看到的標志。
有人知道該怎么做嗎?
謝謝 ,
約翰。
為什么不創建MyObj
List
,遍歷該列表並在f:selectItem
上使用itemDisabled
屬性。
<tr:selectOneChoice>
<tr:forEach items="#{bean.myObjList}" var="myObj">
<f:selectItem itemLabel="#{myObj.label}"
itemValue="#{myObj.value}"
itemDisabled="#{myObj.flag}"/>
</tr:forEach>
</tr:selectOneChoice>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.