Editable dataTable issue

UI Components for JSF
Post Reply
babaguna
Posts: 8
Joined: 06 Oct 2011, 16:04

23 Oct 2014, 11:07

Hi, I've just found something strange in editable dataTable.

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>
testDataTable.java
------------------

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;
  }

}
PF 4.0, Mojarra 2.2.5, Glassfish 4.0

babaguna
Posts: 8
Joined: 06 Oct 2011, 16:04

30 Oct 2014, 16:24

Here you can see the demo:
http://youtu.be/Ghw1-H4cqoo
PF 4.0, Mojarra 2.2.5, Glassfish 4.0

babaguna
Posts: 8
Joined: 06 Oct 2011, 16:04

06 Feb 2015, 12:56

Anyone? :(
PF 4.0, Mojarra 2.2.5, Glassfish 4.0

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests