3 Replies Latest reply on Oct 7, 2010 5:06 AM by Ilya Shaikovsky

    rich:accordion does not work with ui:repeat

    baguette Newbie

      Dear all,

       

      we just started a new Java EE6 project with RichFaces 4.0.0. The first widget to implement happens to be the rich:accordion. However it only work when hardcoding the items. I would like to use it like that:

       

      <h:form>
          <rich:accordion>
              <ui:repeat value="#{navigationBean.navigationCategories.entrySet}" var="category">
                  <rich:accordionItem header="#{category.key}">
                      #{category.value}
                  </rich:accordionItem>
              </ui:repeat>
          </rich:accordion>
      </h:form>

       

      navigationBean.navigationCategories is a map (key: String, value: List). This will throw an exception:

       

      java.lang.NullPointerException
              at org.richfaces.component.AbstractAccordion.getActiveItem(AbstractAccordion.java:50)
              at org.richfaces.renderkit.html.TogglePanelRenderer.doEncodeBegin(TogglePanelRenderer.java:116)
              at org.richfaces.renderkit.html.AccordionRenderer.doEncodeBegin(AccordionRenderer.java:55)
              at org.richfaces.renderkit.RendererBase.encodeBegin(RendererBase.java:115)
              at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:823)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1611)
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)

              [...]

       

      What am i doing wrong?