DataTable + dynamic columns + row editor + validation error + sort = rows data swap:
1. edit row and enter an invalid value.
2. sort the table so the edited row change location
The edited row is getting values from the row that was previously in that location.
It happens only with dynamic columns.
DataTable + dynamic columns + row editor + validation error + sort = rows data swap
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
https://stackoverflow.com/help/mcve please in https://github.com/primefaces/primefaces-test format. And try 6.3-SNAPSHOT please.
I reproduced it with the prime faces test.
The code is the same as the prime faces demo for dynamic columns, only I added a row editor.
Steps to reproduce:
1. edit row
2. enter invalid value for year (e.g. qqq)
3. accept edit - red mark appears next to the invalid value
4. press the year header to sort.
The rows values are swapped.
Here is the code (I can send you back the project if you give me instructions) :
columns.xhtml
The code is the same as the prime faces demo for dynamic columns, only I added a row editor.
Steps to reproduce:
1. edit row
2. enter invalid value for year (e.g. qqq)
3. accept edit - red mark appears next to the invalid value
4. press the year header to sort.
The rows values are swapped.
Here is the code (I can send you back the project if you give me instructions) :
columns.xhtml
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form id="form">
<p:growl id="msgs" showDetail="true"/>
<p:dataTable id="cars" var="car" value="#{dtColumnsView.cars}" widgetVar="carsTable" filteredValue="#{dtColumnsView.filteredCars}" editable="true">
<p:column style="width:32px">
<p:rowEditor />
</p:column>
<p:columns value="#{dtColumnsView.columns}" var="column" columnIndexVar="colIndex" sortBy="#{car[column.property]}" filterBy="#{car[column.property]}">
<f:facet name="header">
<h:outputText value="#{column.header}" />
</f:facet>
<p:cellEditor>
<f:facet name="output"><h:outputText value="#{car[column.property]}" /></f:facet>
<f:facet name="input"><p:inputText value="#{car[column.property]}" style="width:100%" label="Year"/></f:facet>
</p:cellEditor>
</p:columns>
</p:dataTable>
</h:form>
</h:body>
</html>
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Can you please refer me to detailed instructions how to do that?
Thanks.
Thanks.
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
How to put something in a git (or other repository)? Lots and lots of info on that if you use Google. Sorry, but that part is out of 'support-scope' for me here. But if you think it is a bug (or real issue) create an issue in the issuelist and attach the project in a zip file there.
I submitted the issue and attached the zip file as you suggested:
https://github.com/primefaces/primefaces/issues/4186
Thanks for you help.
https://github.com/primefaces/primefaces/issues/4186
Thanks for you help.
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
fixed the data swap by adding resetValues="true" to page, filter, sort and rowEditCancel events.
Losing data is not as bad as swapping...
Losing data is not as bad as swapping...
PrimeFaces: primefaces-8.0
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
Mojara2.3
Netbeans8.2
wildfly-17.0.1.Final
-
- Information
-
Who is online
Users browsing this forum: No registered users and 25 guests