PrimeFaces : How to do a dataTable with dynamic columns ?

You need use : 


Full Example:

<p:dataTable id="resultadosTabela"  scrollWidth="1200px" var="s" value="#{timeLineController.selectSeasonals}" scrollable="true" frozenColumns="1" resizableColumns="true">
      <p:column headerText="Seasonals']}">
         <p:outputLabel value="#{}" />

      <p:columns headerText="#{}" value="#{timeLineController.allColumns}" var="col" columnIndexVar="index">
         <p:outputLabel  value="#{timeLineController.getValue(s, col)}">
            <f:convertNumber type="number" maxFractionDigits="2" minFractionDigits="2"/>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s