I am trying to dynamically generate rich menu items inside a rich context menu component. Here is my code:
<ui:repeat var="group" value="#{myBean.groups}" >
<div align="center">
<rich:panel>
<h:graphicImage value="#{group.iconUrl}"/>
<rich:contextMenu attached="true">
<c:forEach var="child" items="#{group.children}">
<rich:menuItem label="#{child.name}" />
</c:forEach>
</rich:contextMenu>
</rich:panel>
</div>
</ui:repeat>
I am using this tag library :
xmlns:c="http://java.sun.com/jsp/jstl/core
My problem is that the menu items aren't being generated. I have also tried replacing c:forEach with ui:repeat but it still won't work.
I tried a little experimentation to eliminate some factors. I removed rich context menu and used ui:repeat
<ui:repeat var="group" value="#{myBean.groups}" >
<div align="center">
<rich:panel>
<h:graphicImage value="#{group.iconUrl}"/>
<ui:repeat var="child" value="#{group.children}">
<h:outputText value="#{child.name}" />
</ui:repeat>
</rich:panel>
</div>
</ui:repeat>
This code snippet above worked. I guess there is a conflict with the rendering of the context menu and the ui repeat.
Sadly, I really kind of need to place group.children in a rich context menu component. Can you suggest any approach that will help me achieve what I want?
NOTE: I am using servlet version 3.0