2 Replies Latest reply on Jun 19, 2010 6:42 AM by Sergey Vidyuk

    How to not render empty rich:panelMenuGroup

    Sergey Vidyuk Newbie



      I'm using  rich:panelMenu for main menu in my application. There are several rich:panelMenuGroup each of them contains several items. Depending on the logged in user permissions some of items may be not rendered (using rendered="#{s:hasPermission('item_target','read')}" attribute). Some user may have several completely empty groups which is not good. I want to render group at all if it's empty.


      There is a trivial way like rendered="#{s:hasPermission('item1_target','read') or s:hasPermission('item2_target','read') or ...}" but in this case there will be code duplication which may cause unpleasant issues if menu item is moved from one group to another.


      I've looked through the rich:panelMenuGroup tag documentation and didn't fount the way to hide empty group. Is there any way to not render whole rich:panelMenuGroup if none of it's child element is rendered?