I have a strange situation where using @parent, or even explicit id-s dont work in the update attribute. But @form works fine.
I've made a very simple test case, that includes a simple grid whose behaviour is like this :
- * Every record inside the grid has a modify button
* After the modify button is clicked, it'll modify the server data, and the button will be gone, since it'll be only rendered if the record has NOT been modified.
Code: Select all
<!-- this works, since it's using @form in the update attribute -->
<p:column>
<p:commandLink
value="modify record"
process="@this"
action="#{testUserBean.modifyRecord(user)}"
update="@form"
rendered="#{not testUserBean.isRecordModified(user)}" />
</p:column>
Substitute it with @this or @parent or the id of the grid, then it will NOT work. For me it's very logical to use the id of the grid in the update attribute, since i would like to refresh the grid after clicking on the buttton.
I tried making use of
Code: Select all
rowIndexVar="rowIndex"
Code: Select all
myGridId:#{rowIndex}:link
Code: Select all
<!-- this does not work -->
<p:column>
<p:commandLink id="link"
value="modify record"
process="@this"
action="#{testUserBean.modifyRecord(user)}"
update="tblUser"
rendered="#{not testUserBean.isRecordModified(user)}" />
</p:column>
Im using tomcat 7, and these are my dependencies :
Code: Select all
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0.4-b09</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.0.4-b09</version>
<scope>compile</scope>
</dependency>
Thank you !