JSF Primefaces TabView problems

jsfprimefaces

I asked this in the PF Forum but no one seems to want to answer so I though I'd try my luck here.

I have a ui:repeat that is not being updated correctly after an Ajax call when it is within a TabView.

Simple scenario is I have a ui:repeat pointing at an ArrayList (ArrayList contains simple pojos with a String). Within this I have an h:inputText whose value is the pojo's String getter/setter. The ui:repeat is contained within a h:panelGroup. I use a p:commandButton to run an action to update the ArrayList (just add a couple of objects to it a Math.random value for the String) and then update the h:panelGroup. The updated values in the ArrayList are not reflecting in the ui:repeat input fields. This only appears to be affecting input fields as outputText fields do update correctly. Also if I do the same for a p:dataTable the input field are updated correctly. If I remove the Tabview and Tab tags it works fine.

As it works when removing the Tabs I can only assume this is a bug and not designed to work like this. If someone could please confirm if this is so or if there is a viable work around. I need to use a ui:repeat as my fields are not in a tabular format. This has only occurred since migrating from PF 2.2. I'm currently on PF 3.1, Weblogic 10.3.4 and Mojarra 2.0.4

<p:tabView>
    <p:tab title="Test">

        <h:form prependId="false">

            <p:commandButton id="testStringCheck"
                             value="Test String Check"
                             process="@form"
                             update="testPanel"
                             action="#{testBean.generateVOwithRandomStrings}">
            </p:commandButton>

            <h:panelGroup id="testPanel" layout="block">
                <ui:repeat value="#{testBean.voList}" var="entry">
                    <h:outputText value="#{entry.randomString}"/>
                    <p:inputText style="display:block;"
                                 value="#{entry.randomString}"
                                 size="15">
                    </p:inputText>
                </ui:repeat>
            </h:panelGroup>

        </h:form>

    </p:tab>
</p:tabView>

Best Answer

As a workaround I've used a p:datagrid instead of a ui:repeat. This achieves the look I had in the the ui:repeat so I'm happy. Hopefully this bug will be fixed on future releases.

Related Topic