Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax refreshing datatable fails if it's triggered from the record of the same datatable?
    text
    copied!<p>I would like to achieve this :</p> <p>Inside my datatable, in one of the cell, i can trigger an action that can refresh the datatable itself by clicking on the commandLink.</p> <p>But what i experienced is :</p> <p>After triggering the action, everything works as intended, but lacking only in one thing, which is, it doesnt refresh the datatable.</p> <hr> <p>My excerpt goes like this for the link (yes, i know using @all is not a good idea, but this is for the testing purpose):</p> <pre><code>&lt;p:column&gt; &lt;p:commandLink value="Undo" process="@all" action="#{tInputBean.undoRemoveRecord(rpbDetail)}" update="@all" rendered="#{tInputBean.isRemoveRecord(rpbDetail)}" /&gt; &lt;/p:column&gt; </code></pre> <hr> <p>And i tested further, putting a button outside of the , inside the header facet of the datatable, that does nothing but only to refresh the grid :</p> <pre><code>&lt;p:commandButton value="Refresh Data" update="gridRPBDetails" /&gt; </code></pre> <p>So the steps have become :</p> <ol> <li>After clicking on the link, the grid doesnt refresh itself.</li> <li>Clicking on the refresh button actually refreshes the grid, the link vanishes (because of the rendered attribute), which means, all the phases and the states in my JSF Bean is already correct. Only the refresh view phase fails.</li> </ol> <hr> <p>What i would like to achieve is as simple as : clicking on the link, the link itself refreshes and disappears (from the rendered attribute)</p> <p>It seems to me that from my tests, the conclusion is : any record that can trigger an action and refresh the grid that contains that record will fail in the refreshing phase.</p> <p>Any ideas to solve this problem ?</p> <hr> <p>Anyway, i want to share the response after clicking on the "Undo" link from firebug :</p> <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;partial-response&gt;&lt;changes&gt;&lt;update id="javax.faces.ViewState"&gt;&lt;![CDATA[673421645734309925:-3805206326573204566]]&gt;&lt;/update&gt;&lt;/changes&gt;&lt;extension primefacesCallbackParam="validationFailed"&gt;{"validationFailed":false}&lt;/extension&gt;&lt;/partial-response&gt; </code></pre> <hr> <p>Im using tomcat 7, and these are my dependencies :</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.primefaces&lt;/groupId&gt; &lt;artifactId&gt;primefaces&lt;/artifactId&gt; &lt;version&gt;2.2.1&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.sun.faces&lt;/groupId&gt; &lt;artifactId&gt;jsf-api&lt;/artifactId&gt; &lt;version&gt;2.0.4-b09&lt;/version&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;com.sun.faces&lt;/groupId&gt; &lt;artifactId&gt;jsf-impl&lt;/artifactId&gt; &lt;version&gt;2.0.4-b09&lt;/version&gt; &lt;scope&gt;compile&lt;/scope&gt; &lt;/dependency&gt; </code></pre> <hr> <p>UPDATE :</p> <hr> <p>I realize this post dont have a simple example, and would be hard to test and explain, thus, i made a simple example that i have posted <a href="https://stackoverflow.com/questions/5945320/partial-rendering-will-only-work-with-form">here</a>.</p> <p>It's ok if the moderator thinks this post should be removed and do that.</p> <p>Thank you !</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload