2 Replies Latest reply on Feb 13, 2011 12:32 AM by Abhilash Kollipara

    Using rendered tag with rich:column

    Abhilash Kollipara Newbie

      Hi,

       

      I am using rich:dataTable to display my data. I have a requirement where "column 1" should be displayed if the respective rendered tag for the column is true and "column 2" should be displayed if the the respective render tag is true. At any point of time only one of the renderer is true.

       

      What i have tried is:

       

      1.

      <rich:column>

      <f:facet name="header">

      <h:panelGroup>

                <h:outputText value="Grade" rendered="#{record.gradingSystem}"/>

                <h:outputText value="Marks" rendered="#{record.average}"/>

      </h:panelGroup>

      </f:facet>

                <h:outputText value="#{record.grade}" rendered="#{record.gradingSystem}"/>

                <h:outputText value="#{record.score}" rendered="#{record.average}">

                 <f:convertNumber maxFractionDigits="2"/>

                </h:outputText>

      </rich:column>

       

      when i use the above code none of the headers is displayed / empty header is displayed for the column, but data is displayed correct.

      **Please see atachment 1 for the output.

       

      2.

      <rich:column rendered="#{record.gradingSystem}">

      <f:facet name="header">

                <h:outputText value="Grade"/>

      </f:facet>

                <h:outputText value="#{record.grade}"/>

      </rich:column>

       

       

      <rich:column rendered="#{record.average}">

      <f:facet name="header">

                <h:outputText value="Marks"/>

      </f:facet>

                <h:outputText value="#{record.score}">

                 <f:convertNumber maxFractionDigits="2"/>

                </h:outputText>

      </rich:column>

       

      when i use the above code next column header is displayed for this data and the last column appears with out any header.

      **Please see atachment 2 for the output.

       

      Please help me resolve this.

      Thanks & Regards,

      Abhilash.