0

when I use this construct

<t:panelNavigation2 id="panel-nav" expandAll="true">
        <c:forEach items="#{bean.menuItems}" var="menuitem">
            <t:navigationMenuItem value="#{menuitem.value}"
                id="#{menuitem.label}" />
        </c:forEach>
    </t:panelNavigation2>

I get a NullPointerException in the method getMenuItems(). On the other hand

<t:panelNavigation2 id="panel-nav" expandAll="true">
        <t:navigationMenuItems value="#{splex.menuItems}" />
    </t:panelNavigation2>

does work just fine. Where is the difference?

My overall goal is to provide each NavigationMenuItem with a unique id.

Best regards Edmond

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
edmond
  • 833
  • 3
  • 13
  • 31
  • lot of differences. first: the code =) , second, you make a iteration on the first, and seems you don't have all objects to do that and get a NPE – G Bisconcini Feb 05 '15 at 19:59
  • Check for the exception in the said method, if the method itself is the culprit. Although the first approach is clumsy (I would leave the exact reason in the middle), you should use `` instead removing `id="#{menuitem.label}"` and letting `` handle ids on its own using its iterating index. – Tiny Feb 05 '15 at 20:08
  • Please include the exception stack trace. – gknicker Feb 05 '15 at 20:11
  • Since JSTL is executed at build time. I think this is causing the problem. There is nothing to show yet. – Eduardo Briguenti Vieira Feb 05 '15 at 20:12
  • 1
    Is this acceptable as duplicate? http://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense/ – BalusC Feb 05 '15 at 20:55

0 Answers0