3 Replies Latest reply on Aug 15, 2008 6:38 AM by Ramya Lanka

    How to add columns dynamically to my rich dataTable

    Ramya Lanka Newbie

      Hi

      I am using rich dataTable to display a list of objects , in which each object again has got a list which would add as dynamic columns to same dataTable .

      My xhtml code is :

      <rich:dataTable
      cellpadding="0" cellspacing="0"
      width="700" border="0" var="subpax" value="#{subpaxTypes}" rendered="#{subpaxTypes.rowCount>0}">
      <f:param name="subpaxtype" value="#{subpax.subpaxTypeName}" />
      <rich:column>
      <f:facet name="header">
      <h:outputText value="" />

      </f:facet>
      <h:panelGrid columns="1">
      <h:outputText value="#{subpax.subpaxTypeName}" />
      </h:panelGrid>
      </rich:column>
      <rich:column>
      <f:facet name="header"><h:outputText value="SeqNo#" /></f:facet>
      <h:panelGrid columns="1">
      <h:outputText value="#{subpax.subpaxTypeSequenceId}" align="center"/>

      </h:panelGrid>
      </rich:column>
      <rich:column>
      <ui:repeat value="#{SubpaxTypeAction.availableTrackList}" var="tr" >
      <f:facet name="header"><h:outputText value="#{tr.trackName}"/>
      </f:facet>
      <rich:column>
      <h:panelGrid columns="1">
      <h:selectBooleanCheckbox title="isTrackforEach" />
      </h:panelGrid>
      </rich:column>
      </ui:repeat>
      </rich:column>

      </rich:dataTable>



      By using the above code I am able to display all the dynamic columns also but the header part of the columns added dynamically is not being rendered. Can anyone help me in this regard?

      Thanks in Advance
      Ramya