jsf - p:datatable with two lists as input -
i have 2 lists. 1 of strings contains column names(which names of properties have displayed) , 1 of objects populate table. right use html table , ui:repeat display info:
<table border="1px"> <tr> <ui:repeat value="#{bean.columnnames}" var="col"> <th><h:outputtext value="#{col}" /> </th> </ui:repeat> </tr> <ui:repeat value="#{createreportbean.reportresults}" var="row"> <tr> <ui:repeat value="#{createreportbean.columnnames}" var="col"> <td><h:outputtext value="#{row[col]}"</td> </ui:repeat> </tr> </ui:repeat> </table>
i'm doing because need attributes contained in columnnames displayed. can achieve similar p:datatable?
Comments
Post a Comment