如何排除子组件的父组件的AJAX更新?

如何排除子组件的父组件的AJAX更新?

问题描述:

我使用PrimeFaces <电话号码:AJAX>在我的code 标记。我们怎样才能排除在Ajax调用得到更新的更新父组件的子组件?

I am using PrimeFaces <p:ajax> tag in my code. How we can exclude a child component from getting updated in an ajax call that update a parent component?

如果您使用的是至少PrimeFaces 3.3,那么你可以使用的 PrimeFaces选择器了解这一点。这允许您使用 jQuery的CSS选择器语法过程和更新属性。

If you're using at least PrimeFaces 3.3, then you can use PrimeFaces Selectors for this. This allows you using jQuery CSS selector syntax in process and update attributes of PrimeFaces ajax components.

例如:

<h:form>
    <h:inputText ... />
    <h:inputText ... />
    <h:inputText ... styleClass="noupdate" />
    <h:inputText ... />
    <h:inputText ... />
    <p:commandButton ... update="@(form :not(.noupdate))"/>
</h:form>

这个例子除了有输入类=NOUPD​​ATE在客户端更新整个窗体。

This example will update the entire form except for inputs having class="noupdate" in the client side.