p:datatable rowEdit won't update hole table

UI Components for JSF
Post Reply
helija
Posts: 5
Joined: 05 Nov 2013, 12:27

18 Nov 2013, 14:34

How can we update all table data from ajax listener rowEdit?
In bean method for rowEdit, beside current row changes made in GUI, we manual change values for some columns in other rows but they are not updated in page - just current row that was edited. (example: only one checkBox in table can be set to true, all other are unchecked; in bean we uncheck all other check boxes in all rows)
At the end of the method bean.onEdit, table model is refresh with all changes and set with correct data, but this data are not shown on page?? Only one row that was editing.


Part of the xhtm code:

Code: Select all

 
<h:form id="form-table">
	<p:dataTable id="structuresTable"  editable="true" 
					value="#{bean.structureDataModel}"
					var="currRow" selection="#{bean.currentRow}"
					selectionMode="single">

					<p:ajax event="rowSelect"
						update=":otherPanel "
						listener="#{bean.onRowSelect}">
					</p:ajax>

					<p:ajax event="rowEdit"
						update="@this :msgs"
						listener="#{bean.onEdit}">
					</p:ajax>

                                <p:column >
						 .......
					</p:column>
</p:dataTable
</h:form>
I try various combination in

Code: Select all

<p:ajax event="rowEdit"
						update="@this :msgs"
						listener="#{bean.onEdit}">
					</p:ajax>
and set update ":form-table" or "@form" or ":form-table:structuresTable" but nothing work. Just current row that is being edit was change. In some cases (":form-table") hole table loose complete structure and display data all over the page...
How is this caused and how can we update hole table in this case?
Thanks!

Mojarra 2.2.4, PF 4.0

rsisto
Posts: 1
Joined: 15 Jan 2014, 21:40

18 Feb 2014, 21:31

Hi,

I am having the same issue.
If I update the parent p:dataTable, the response removes the table and renders only the updated row. The same happens if I try to update any of the parents which contain the dataTable.

Please let me know if you need additional information.
Updating the whole dataTable is required because I need to color the other rows depending on the edited data.

Thanks in advance.
Regards.

opaczkowski
Posts: 18
Joined: 07 Oct 2014, 09:32

16 Dec 2014, 18:42

Anyone with an idea about this problem? I'm facing the same problem, that in some cases the data structure is lost.
Using p:rowedit component.

I'll try to post an example later on.
Primefaces 5.1
Primefaces extensions 3.0.0
tomcat 8.0.9
Java 7

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

16 Dec 2014, 20:35

Putva panel around it and update that

opaczkowski
Posts: 18
Joined: 07 Oct 2014, 09:32

17 Dec 2014, 08:57

Ok, thanks. I'll try that.

Can you provide some information why this problem occurs?
Especially I wonder, that I have different types of tables with similar structure. Most of them work well, some of them don't...
Primefaces 5.1
Primefaces extensions 3.0.0
tomcat 8.0.9
Java 7

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

17 Dec 2014, 14:21

opaczkowski wrote: Can you provide some information why this problem occurs?
No idea, maybe because the datatable is somewhat different compared to other components with regard to the moment things are 'rendered'. Updating the component from within the component might cause this behaviour.
opaczkowski wrote:Especially I wonder, that I have different types of tables with similar structure. Most of them work well, some of them don't...
Similar != identical. And if the others are e.g. not updated from within the datatable itself that might explain the difference

opaczkowski
Posts: 18
Joined: 07 Oct 2014, 09:32

19 Dec 2014, 09:17

I found out, that there were two updates from Beans, one on the table and one on the surrounding panel. Somehow these interfere with each other.

Still I have no clue why the problem occurs in one table and not the other, and in one context and not another.
Stay tuned... ;)
Primefaces 5.1
Primefaces extensions 3.0.0
tomcat 8.0.9
Java 7

pjt1
Posts: 17
Joined: 11 Oct 2012, 01:12

30 Jan 2015, 21:07

This sounds like the same issue I had......a few workarounds listed here:
http://forum.primefaces.org/viewtopic.php?f=3&t=40999
Primefaces 6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests