3
votes

A have a page something like this:

<h:form id="form">
    <h:panelGroup id="panel">
        <ui:repeat id="repeat" value="#{myBean.ojects}" var="item">
            <h:panelGroup id="itemPanel">

                <h:selectOneMenu ..... >
                    <p:ajax process="@this" update="itemPanel"/>
                    <f:attribute name="item" value="#{item}" />
                </h:selectOneMenu ..... >

            <h:inputText id="value" value="#{item.property}"/>

            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>

My problem is that after I change the "property" value of the object reference inside the bean, and update the "itemPanel" panelGroup, it never returns the modified value unless I update the entire panelGroup that I have wrapped around the ui:repeat. In the first case I can see in the response that the update has occurred, only with the previous value. I really must be able to only reaload one part part of the ui:repeat (in with the value was changed), otherwise added, but not submitted data inside other parts (cycles) of the ui:repeat would be lost.

UPDATE:

I actually would not care, if I would have to submit the panel or form that contains the entire repeat, so when I update it the values don't change, however if I change the process value, nothing gets updated at all .. :(

2
I have tried all possible combinations, I don't think that is the issue. - Peter Jaloveczki
Have you find the solution ? I have similar problem - Michal Heneš

2 Answers

0
votes

can you try it like this:

<h:form id="form">
    <h:panelGroup id="panel">
        <ui:repeat id="repeat" value="#{myBean.ojects}" var="item" varStatus="varStatus">
            <h:panelGroup id="itemPanel">

                <h:selectOneMenu ..... >
                    <p:ajax process="@this" update="repeat:#{varStatus.index}:itemPanel"/>
                    <f:attribute name="item" value="#{item}" />
                </h:selectOneMenu ..... >

                <h:inputText id="value" value="#{item.property}"/>

            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>
0
votes
<h:form id="form">
    <h:panelGroup id="panel">
        <ui:repeat id="repeat" value="#{myBean.ojects}" var="item" varStatus="varStatus">
            <h:panelGroup id="itemPanel" class="item-#{varStatus.index}">

                <h:selectOneMenu ..... >
                    <p:ajax process="@this" update="@(.item-#{varStatus.index})"/>
                    <f:attribute name="item" value="#{item}" />
                </h:selectOneMenu ..... >

                <h:inputText id="value" value="#{item.property}"/>

            </h:panelGroup>
        </ui:repeat>
    </h:panelGroup>
</h:form>

remember to put the id because the update is necessary