0

I have a problem with nested ui:repeat.

I have the next code:

    <h:form>
        <ui:repeat var="cartItem" value="#{shoppingCartBean.shoppingCartElements}">
        ... //cartItem info

            <h:commandButton>
                <f:ajax listener="#{shoppingCartBean.changePortabilityEvent(cartItem)}"/>
            </h:commandButton>

            <ui:repeat var="discount" value="#{shoppingCartBean.getItemDiscounts(cartItem)}">
                ... //discounts info
            </ui:repeat>

        </ui:repeat>
    <h:form>

Well, when I click on the button, is like the ajax POST call is fired but the page is processed and the cartItem is null when the button is pressed, so it generates a NullPointerException.

My bean (shoppingCartBean) is SessionScope.

Any idea why?

Thanks in advance.

dcalap
  • 1,048
  • 2
  • 13
  • 37
  • Which JSF impl/version? Tried the latest? – BalusC Oct 29 '13 at 17:14
  • jboss-jsf-api_2.1_spec-2.0.7.Final-redhat-1.jar and jsf-impl-2.1.13-redhat-1 but is a big project, I think we can't change it easily... – dcalap Oct 29 '13 at 17:24
  • 1
    Well, if you can't upgrade, then bite the bullet and use `` instead. True, it generates a HTML table which might not be what you need, but it doesn't expose that `` bug in older Mojarra versions. – BalusC Oct 30 '13 at 13:38

0 Answers0