我正在使用PrimeFaces< p:ajax>我的代码中的标签我们如何排除子组件在更新父组件的ajax调用中得到更新?
如果您至少使用PrimeFaces 3.3,那么可以使用
PrimeFaces Selectors.这允许您使用
jQuery CSS selector syntax在PrimeFaces ajax组件的进程和更新属性.
例如:
<h:form>
<h:inputText ... />
<h:inputText ... />
<h:inputText ... styleClass="noupdate" />
<h:inputText ... />
<h:inputText ... />
<p:commandButton ... update="@(form :not(.noupdate))"/>
</h:form>
该示例将更新整个表单,除了客户端中具有class =“noupdate”的输入.
如果要更新除特定组件之外的所有子项,请将“form”替换为周围组件的id(或类或…)
<h:form id="form">
<h:panel id="myPanel">
<h:inputText ... />
<h:inputText ... />
<h:inputText ... styleClass="noupdate" />
</h:panel>
<h:inputText ... />
<h:inputText ... />
<p:commandButton ... update="@(form :not(.noupdate))"/>
</h:form>
<p:commandButton ... update="@(#form\:myPanel :not(.noupdate))"/>
只需确保使用完整的客户端ID.