I have a p:menuButton in a p:column in a p:dataTable.
So far everything works fine.
Now I want to make the menuButton dynamic. However c:foreach is evaluated before rendering the table and primefaces doesn't like to use ui:repeat inside the p:menuButton.
How can I create a number of p:menuitem dynamically based on a collection on the row item I am looping over, i.e. what should I do instead of ?:someKindOfLoop in the example below?
<p:dataTable value='#{something.collection}' var='item'>
...
<p:column>
...
<p:menuButton value="Actions">
<p:menuitem value="View ..."
...>
<f:param name="something" value="#{item.id}"/>
</p:menuitem>
<?:someKindOfLoop x="#{item.subCollection}" y="var">
<p:menuitem value="View sub list "
...>
<f:param name="#{var.name}" value="#{var.id}"/>
</p:menuitem>
</?:someKindOfLoop>
</p:menuButton>
...
</p:column>
</p:dataTable>
Googling yields a number of similar cases, however I haven't found one yet that wasn't either about dynamically creating columns (like this: Why can <c:forEach> or <ui:repeat> not access <p:dataTable var>? ) or that doesn't deal with primefaces.