I'd like to keep a part of my menu static in markup, and have another part dynamically generated in Java.
<p:menubar>
<p:menuitem value="static stuff"/>
<p:submenu label="dynamic stuff" model="#{bean.dynamicMenu}"/>
<!-- more static stuff -->
</p:menubar>
This shows only the static items and never calls my getDynamicMenu
method cause p:submenu
does not take a model
attribute.
I tried using ui:include
within the menu structure to move the markup in an extra file and include that in different contexts, but Primefaces complained that it does not like that as child element of p:menubar
and / or p:submenu
.
How can I keep parts of my menu static in xhtml and parts dynamic in Java?