Hi, I was wondering why this fragment renders well all its MenuModel tabs:

         <tr:navigationPane hint="tabs" value="#{tabBean.tabData}" var="tab">
            <f:facet name="nodeStamp">
                 <tr:commandNavigationItem text="#{tab.label}" action=""/>
             </f:facet>
             <tr:commandNavigationItem/>
        </tr:navigationPane>

while this renders nothing:

         <tr:navigationPane hint="tabs" value="#{tabBean.tabData}" var="tab">
            <f:facet name="nodeStamp">
                 <tr:commandNavigationItem text="#{tab.label}" action=""/>
             </f:facet>
         </tr:navigationPane>

The problem is located in NavigationPanelRenderer.encodeAll() method, which skips rendering if there are no children. However tabs can be defined either by children or by stamping, so that having at least one dummy child like in my example is enough to trigger rendering (rendering actually occurs by stamping, they are mutually exclusive).
I think that the test:

    if (renderedItemCount > 0)

should be something like:

    int renderedRowCount = (
(UIXHierarchy)component).getRowCount();
    if (renderedItemCount > 0 || renderedRowCount > 0)

Btw, I'm using a simple one-level MenuModel for this. It works, exept for method getAction on items which is never called. GetLabel is called, though.

-- Renzo



Reply via email to