0

ネストされた ui:repeat に問題があります。

私は次のコードを持っています:

    <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>

ボタンをクリックすると、ajax POST 呼び出しが実行されますが、ボタンが押されるとページが処理され、cartItem が null になるため、NullPointerException が生成されます。

私の Bean (shoppingCartBean) は SessionScope です。

理由はありますか?

前もって感謝します。

4

0 に答える 0