如何AJAX的更新号码:dataTable的本身:从p内的dataTable? [英] How to ajax-update the p:dataTable from inside the p:dataTable itself?

查看:468
本文介绍了如何AJAX的更新号码:dataTable的本身:从p内的dataTable?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<h:form id="formId">
   <p:wizard id="wizardId">
      <p:tab id="tabId">
         <p:dataTable id="tableId">
           <p:column>
             <h:commandLink value="remove" update=""/>
           </p:column>
         </p:dataTable>
      </p:tab>
   </p:wizard>
</h:form>

我需要更新仅&LT;电话号码:dataTable的&GT; 无整个表单。 我试图用 @form @parent :formId:wizardId:tabId:TABLEID ,但他们没有工作,因为我想要的。当我使用 @form ,它检查验证,因而我并不需要做什么。

I need to update only the <p:dataTable> without the entire form. I tried using @form, @parent, :formId:wizardId:tabId:tableId, but none of them are working as I want. When I use @form, it is checking for validation which I don't need to do.

我怎样才能做到这一点?

How can I achieve this?

推荐答案

首先,这确实是从来没有的工作与&LT; H:commandLink&GT; ,仅仅是因为它不支持更新属性在所有。也许你实际上意味着使用&LT;电话号码:?commandLink&GT;

First of all, this will indeed never work with a <h:commandLink>, simply because it doesn't support the update attribute at all. Perhaps you actually meant to use <p:commandLink>?

一旦你已经解决了&LT; H:commandLink&GT; 是一个&LT;电话号码:commandLink&GT; ,然后前往这个答案:<一href="http://stackoverflow.com/questions/8634156/how-to-reference-components-in-jsf-ajax-cannot-find-component-with-identifier/8644762#8644762">How引用组件的JSF AJAX?无法找到标识符QUOT组成部分;富&QUOT;鉴于了解如何引用组件JSF AJAX。

Once you've fixed the <h:commandLink> being a <p:commandLink>, then head to this answer: How to reference components in JSF ajax? Cannot find component with identifier "foo" in view to learn how to reference components in JSF ajax.

看了这个答案后,你应该已经发现,在数据表中确定的这个特殊的code段:formId:TABLEID 。因此,所有的一切,下面应该做的:

After having read that answer, you should have found out that the datatable is in this particular code snippet identified by :formId:tableId. So, all with all, the following should do:

<p:commandLink value="remove" update=":formId:tableId" />

请注意,有是直到与PrimeFaces 3.3 AJAX-更新的℃的错误;号码:dataTable的&GT; 在某些复杂的UI组成。这是在PrimeFaces 3.4固定。如果您遇到正是这个问题,不能升级到PrimeFaces 3.4,那么你就需要来包装一些&LT表; H:panelGroup中的id =tablePanelId&GT; 然后用更新=:formId:tablePanelId而不是

Note that there's until with PrimeFaces 3.3 a bug in ajax-updating of the <p:dataTable> in certain complex UI compositions. This is fixed in PrimeFaces 3.4. If you encounter exactly this problem and can't upgrade to PrimeFaces 3.4, then you'd need to wrap the table in some <h:panelGroup id="tablePanelId"> and then use update=":formId:tablePanelId" instead.

这篇关于如何AJAX的更新号码:dataTable的本身:从p内的dataTable?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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