成功调用ajax后,Datatable不会更新

Mur*_*zen 8 ajax jsf primefaces jsf-2

我有一个数据表.该表的每一行都有一个commandButton名为"Remove"的行,它应该从模型和视图中删除该行并就地执行更新.作为一个页脚,我有另一个commandButton名为'删除每一行'.

最后一个按钮有效.我点击它,每一行都从模型中删除(即ArrayList包含元素变为空),dataTablefooter facet在视图中重新渲染(或更新).

另一方面,当我单击其中一行上的按钮时,为了将其删除,它会部分起作用.从模型中删除相应的元素,但不更新视图.那行还在那里,dataTablefooter facet没有改变.

我的代码中有以下代码users.xhtml.

<f:metadata>
    <f:viewParam name="id" value="#{users.id}" />
    <f:event type="preRenderView" listener="#{users.init}" />
</f:metadata>

...

<h:form id="usersForm">
    <p:outputPanel>    
        <p:dataTable id="userTable" value="#{users.user.friendList}" var="friend">
            <p:column>
                <h:outputText value="#{friend.name}" />
            </p:column>
            <p:column>
                <p:commandButton action="#{users.user.removeFriend(friend)}"
                    ajax="true"
                    update="userTable somethingElse" process="@this"
                    onerror="errorDialog.show();"
                    icon="ui-icon-delete"
                    title="delete user">
                </p:commandButton>
            </p:column>

            <f:facet id="somethingElse" name="footer">  
                    aye: ${users.user.xxx}
            </f:facet>
        </p:dataTable>

    </p:outputPanel>

    <p:commandButton action="#{users.user.removeAllFriends()}" ajax="true"
                update="userTable somethingElse"
                process="@this"
                icon="ui-icon-close"
                value="delete all friends?">
    </p:commandButton>


</h:form>
Run Code Online (Sandbox Code Playgroud)

那么,您认为这里的问题是什么?

我正在使用JSF 2.0和Primefaces 3.0

Bal*_*usC 12

我从当前的PF 3.0页面中认识到这个问题.如果您使用它将会起作用update="@form".我没有真正的时间来调查真正的原因,以便我可以向PF人员报告,因为这个问题并没有在所有页面中出现.即使在同一张桌子中,一个不同的按钮也可以用作.

试试看:

<p:commandButton update="@form" ... />
Run Code Online (Sandbox Code Playgroud)

更新:想想它,它可能与存在有关process="@this".