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

前端之家收集整理的这篇文章主要介绍了如何排除父组件的ajax更新中的子组件?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用PrimeFaces< p:ajax>我的代码中的标签我们如何排除子组件在更新父组件的ajax调用中得到更新?
如果您至少使用PrimeFaces 3.3,那么可以使用 PrimeFaces Selectors.这允许您使用 jQuery CSS selector syntax在PrimeFaces ajax组件的进程和更新属性.

例如:

  1. <h:form>
  2. <h:inputText ... />
  3. <h:inputText ... />
  4. <h:inputText ... styleClass="noupdate" />
  5. <h:inputText ... />
  6. <h:inputText ... />
  7. <p:commandButton ... update="@(form :not(.noupdate))"/>
  8. </h:form>

该示例将更新整个表单,除了客户端中具有class =“noupdate”的输入.

如果要更新除特定组件之外的所有子项,请将“form”替换为周围组件的id(或类或…)

  1. <h:form id="form">
  2. <h:panel id="myPanel">
  3. <h:inputText ... />
  4. <h:inputText ... />
  5. <h:inputText ... styleClass="noupdate" />
  6. </h:panel>
  7. <h:inputText ... />
  8. <h:inputText ... />
  9. <p:commandButton ... update="@(form :not(.noupdate))"/>
  10. </h:form>
  11.  
  12. <p:commandButton ... update="@(#form\:myPanel :not(.noupdate))"/>

只需确保使用完整的客户端ID.

猜你在找的Ajax相关文章