开发者

how to create rich:dropDownMenu dynamically using c:foreach?

开发者 https://www.devze.com 2023-01-31 06:16 出处:网络
I wanted to populate a dropdowm menu dynamically, so i used <c:forEach> but i\'m not able see the data in the frontend.

I wanted to populate a dropdowm menu dynamically, so i used <c:forEach> but i'm not able see the data in the frontend.

My 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>

My Managed 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;
}

I'm using JSF 1.1 .


This could help: http://mkblog.exadel.com/2009/01/creating-richdropdownmenu-dynamically/

0

精彩评论

暂无评论...
验证码 换一张
取 消