I want to arrange p:column dynamically i.e. p:column header value should be come from database and it increase or decrease according to database value. please suggest me ..
You should use the <p:columns , take a look at the showcase DataTable - Dynamic Columns
here a code snippet from the showcase
<p:dataTable id="cars" var="car" value="#{tableBean.carsSmall}">
<p:columns value="#{tableBean.columns}" var="column" columnIndexVar="colIndex"
sortBy="#{car[column.property]}" filterBy="#{car[column.property]}">
<f:facet name="header">
#{column.header}
</f:facet>
#{car[column.property]}
</p:columns>
</p:dataTable>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With