When you have a column set as rendered="false" once you click on edit and then click cancel or save - the rowEditor pencil disappears
If the column is set as rendered="true"(or not set at all) it behaves as expected.
This is on PF 5.1, Mojarra 2.2.7, Glassfish 4.1
Here is the code:
index.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>
</h:head>
<h:body>
<h:form>
<p:dataTable id="cars1" var="car" value="#{testDataTable.testData}" editable="true">
<p:column headerText="col 1">
<p:cellEditor>
<f:facet name="output">#{car.toString()}</f:facet>
<f:facet name="input">#{car.toString()}</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="col 2" rendered="false">
<p:cellEditor>
<f:facet name="output">#{car.toString()}</f:facet>
<f:facet name="input">#{car.toString()}</f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor />
</p:column>
</p:dataTable>
</h:form>
</h:body>
</html>
------------------
Code: Select all
package test.dataTable;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
@ViewScoped
@Named
public class testDataTable implements Serializable {
private List<String> testData;
@PostConstruct
public void testDataTableInit() {
testData = new ArrayList<>();
testData.add("value 1");
testData.add("value 2");
}
public List<String> getTestData() {
return testData;
}
public void setTestData(List<String> testData) {
this.testData = testData;
}
}