如何排除子组件的父组件的AJAX更新? [英] How to exclude child component in ajax update of a parent component?

查看:161
本文介绍了如何排除子组件的父组件的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选择器语法过程和< PrimeFaces的Ajax组件code>更新属性。

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.

这篇关于如何排除子组件的父组件的AJAX更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆