0
votes

I am using PrimeFaces 5.1 in my project. I need single row split multiple rows. In below image link 6 column onwards multiple rows.If same option how can I do? In dataTable beanlist value another beanlist i.e In below link first 5 columns is first list and next 6 onwards is second list.My doubt how split it. I try ui:repeat and c:foreach but not working and p:panelgrid tried but it's head show inside columen but I need to set header for parent table for dataTable.

  [1]: http://i.stack.imgur.com/MrMSE.jpg
1
Did you check the possibilities in the PF showcase? For example the "expansion" datatable?Jaqen H'ghar
@Jaqen I need at a time to show same row but in row expansion click to expand and show belowVenkiArun

1 Answers

0
votes

To solve your problem you need a solution like a subTable but in new versions of Primefaces it was deprecated. In that case you can use a nested dataTables, and will resolve your problem.

Look this example:

<p:dataTable var="f" value="#{myMB.listFiles}">
    <f:facet name="header">
         Files
     </f:facet>

    <p:column headerText="File Name">
        <h:outputText value="#{f.name}" />
    </p:column>

    <p:column headerText="Details">
        <p:dataTable var="d" value="#{f.listDetails}" styleClass="myTable" >
            <p:column>
                <p:panelGrid columns="3">
                    <p:outputLabel value="#{d.time}" />
                    <p:outputLabel value="#{d.operation}" />
                    <p:outputLabel value="#{d.status}" />
                </p:panelGrid>
            </p:column>
        </p:dataTable>
    </p:column>
</p:dataTable>

One problem is if the header of your subGroup list wasn't defined, a little bar of your column header will be showed, but with a simple css you can remove this problem.

.myTable thead {
    display:none;
}

Reference: