Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make PrimeFaces dataTable editable by default

I'm working on JSF2, PrimeFaces 3. Is there a way to make the dataTable editable by default so the users do not have to click the rowEditor button?

I'm using the dataTable for taking user inputs initially.

like image 409
setzamora Avatar asked Mar 31 '26 17:03

setzamora


1 Answers

Dont Keep rowEditor in the datatable. Have the editable components like inputText and selectOneMenu in the cells. Input and output facet are redundant.

<p:dataTable id="myTable" value="#{bean.list_dtls}" var="dataItem">
    <p:column>
         <f:facet name="header">
               <h:outputLabel value="Field 1" />
         </f:facet>
         <p:inputText value="#{dataItem.myField}" />
    </p:column>
</p:dataTable>
like image 91
rags Avatar answered Apr 03 '26 06:04

rags