2

I have the following component tree on my page

form
    tabView
        datatable
        dialog

Now I want to update the dialog component when a row is selected in the datatable.

I tried something like:

<p:ajax event="rowSelect" update="@parent:detailsView" oncomplete="detailsViewDialog.show()" />

where detailsView is the id of a panelGroup within the p:dialog.

Only having update="@parent" works but is it not a solution to always reload the whole table only to display the dialog.

Can anybody give me a hint?

Regards, Florian

4

1 回答 1

4

数据表本身就是一个NamingContainer组件,因此很难使用相对的客户端 ID。您基本上需要指定绝对客户端 ID:

<p:ajax ... update=":formId:tabViewId:detailsView" />

或者,您也可以通过属性将 with ID 绑定到UIComponent视图detailsView并在属性中使用:bindingUIComponent#getClientId()update

<p:ajax ... update=":#{detailsView.clientId}" />
...
<h:panelGroup id="detailsView" binding="#{detailsView}">
于 2013-01-06T15:29:58.117 回答