I need a way to create editable table like this. I interested is it possible to use h:panelGrid to display and edit the data. From my previews post I saw that it's possible to simple JSF table, but is this possible with h:panelGrid?
<table> <ui:repeat var="elem" value="#{yourMB.yourDataList}"> <tr> <td>#{elem.userid}</td> <td> <h:outputText value="#{elem.name}" rendered="#{not elem.editable}" /> <h:inputText value="#{elem.name}" rendered="#{elem.editable}" /> </td> <td> <h:outputText value="#{elem.telephone}" rendered="#{not elem.editable}" /> <h:inputText value="#{elem.telephone}" rendered="#{elem.editable}" /> </td> <td> <h:commandLink value="Edit" rendered="#{not elem.editable}" action="#{yourMB.editAction(elem)}" /> </td> </tr> </ui:repeat> </table> <h:commandButton value="Save Changes" action="#{yourMB.saveAction}" />
h:panelGridis that you can't iterate through a list inside it.h:panelGridis more like a container where you arrange UI widgets, andui:repeatandh:dataTableare the ones appropriate for iterating through a list/collection.h:panelGridinstead ofh:dataTable?