I'm working with PrimeFaces 3.1.1 since last week and it seems to be an excellent visual component framework. I'm doing a migration from Richfaces and trying to get everything working only with Prime and JSF2 (2.1.6 version).
My problem comes with a dynamic toolbar I have to implement. Some of the operations are integrated directly on the toolbar (commandButtons) and other operations have some suboperations inside, so I have to do a menuButton with the operation name and add every single operation here like a menuitem. Here is my code:
<h:panelGroup id="Texto_Header" layout="block">
<h:form>
<p:toolbar>
<p:toolbarGroup>
<!-- Operaciones de aplicación -->
<ui:repeat value="#{logedBean._apps}" var="opBean">
<!-- OPERACION PRINCIPAL EJECUTABLE -->
<h:panelGroup rendered="#{opBean._Clickable}">
<p:commandButton ajax="true" value="#{opBean._Nombre}"
action="#{opBean.actionOperationClick}" />
</h:panelGroup>
<!-- OPERACION PRINCIPAL CON SUBOPERACIONES -->
<h:panelGroup rendered="#{!opBean._Clickable}">
<p:menuButton value="#{opBean._Nombre}">
<ui:repeat value="#{opBean._subOperaciones}" var="opBean2">
<p:menuitem ajax="true" value="#{opBean2._Nombre}"
actionListener="#{opBean2.actionOperationClick}" />
</ui:repeat>
</p:menuButton>
</h:panelGroup>
</ui:repeat>
</p:toolbarGroup>
</p:toolbar>
</h:form>
</h:panelGroup>
My problem is I'm getting only the first operation components, it renders the commandButtons correctly and their actions are working well, however in the case of "#{!opBean._Clickable}" I get a menuButton with the name, but no menuitem inside. It looks like the embeded ui:repeat iteration is not being well done.
I have tried the same chance using c:foreach, c:choose and c:otherwise tags and in this case I get the menus visually well done, commandButton actions are working well too, but when I click in a menuItem it's saying that opBean2 is not recognized... However as I have said before, I prefer to use JSF tags exclusively. Is there a way to do that?