我想动态填充下拉菜单,所以我使用<c:forEach>
,但我无法在前端看到数据。
我的JSF
<rich:dropDownMenu id="drop_down" value="Add"
direction="bottom-right" jointPoint="auto">
<c:forEach var="item" items="#{library.addLeftPanel}" >
<rich:menuItem submitMode="ajax" value="#{item}"
actionListener="#{library.populateCBConditions}"
reRender="tree_comp, filtab" />
</c:forEach>
</rich:dropDownMenu>
我的托管Bean
private List<String> addLeftPanel;
/**
* @param addLeftPanel
* the addLeftPanel to set
*/
public void setAddLeftPanel(List<String> addLeftPanel) {
this.addLeftPanel = addLeftPanel;
}
/**
* @return the addLeftPanel
*/
public List<String> getAddLeftPanel() {
if(null==addLeftPanel){
addLeftPanel = new ArrayList<String>();
addLeftPanel.add("First");
addLeftPanel.add("Secound");
}
return addLeftPanel;
}
我正在使用JSF 1.1。
答案 0 :(得分:2)