6 Replies Latest reply on Feb 14, 2011 7:49 AM by eldiegolp

    RichFaces 3.3.3 + dataTable + align footer

    edilmar

      Hi,

       

      I have an webapp with NB6.8+JSF2+RichFaces3.3.3+GFv3 with a rich:dataTable.

      Then, I would like to know how to align the footer of a column to the right.

      Here is the code of my column "Valor Venc.":

       

      <rich:column width="70px" id="valorVenc" style="text-align:right;">
        <f:facet name="header"><h:outputText styleClass="headerText" value="Valor Venc." /></f:facet>
        <h:outputText value="#{item.valorVenc}"><f:convertNumber minFractionDigits="2"/></h:outputText>
        <f:facet name="footer">
          <h:outputText value="#{consTitulosCliente.somaValorVenc}"><f:convertNumber minFractionDigits="2"/></h:outputText>
        </f:facet>
      </rich:column>
      

       

      Look that rich:column has the "style" for right alignment.

      But the table shows this... look that "62.713,09" is aligned to left...

      FooterAlign.jpeg

       

      Thanks for any help.

        • 1. Re: RichFaces 3.3.3 + dataTable + align footer
          edilmar

          Is it possible to be a bug at RichFaces?

          I have this problem since 3.3.2, and also in 3.3.3.

          • 2. Re: RichFaces 3.3.3 + dataTable + align footer
            ilya_shaikovsky

            define .rich-table-footercell CSS class and put text-align here or use headerClass and footerClass.

             

            In general maybe absense of corresponding styles attributes could be considered as minor issue - but I prefer not to do it as using inline styles pretty bad practice, so the attributes is not really needed there.

            • 3. Re: RichFaces 3.3.3 + dataTable + align footer
              edilmar

              Hi friend,

               

              I put style="text-align:right" into outputText to test but it didn't work.

               

              <rich:column width="70px" id="valorVenc" style="text-align:right;">
                  <f:facet name="header"><h:outputText styleClass="headerText" value="#{msgCliente['consTitulos.table.labelValorVenc']}" /></f:facet>
                  <h:outputText value="#{item.valorVenc}"><f:convertNumber minFractionDigits="2"/></h:outputText>
                  <f:facet name="footer">
                      <h:outputText value="#{consTitulosCliente.somaValorVenc}" style="text-align:right;"><f:convertNumber minFractionDigits="2"/></h:outputText>
                  </f:facet>
              </rich:column>
              

               

              I think that all <f:facet name="footer"> should use the same style of its "father" <rich:column...>.

               

              Is this a limitation of <rich:dataTable>/<rich:column>?

               

              The class .rich-table-footercell doesn't have a property for text-align. I look at this document: http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_dataTable.html

              • 4. Re: RichFaces 3.3.3 + dataTable + align footer
                ilya_shaikovsky

                header uses headerClass, cells uses styleClass and footer uses footerClass. And header and footer has prefdefined classes I mentioned above. Style as the styleClass is applied only to cells. And there are not headerStyle and footerStlye attribute which analogous to styleClass but for the corresponding elements. So please just use the classes as I already proposed. And b.t.w. if you insist on using just stlyes and believe that it's a bug that we have no such attributes - check some optimization articles. Using inline stlyes is really bad practice.

                • 5. Re: RichFaces 3.3.3 + dataTable + align footer
                  edilmar

                  Hi friend,

                   

                  Thank you... I solved with footerClass easily... before I had not understand how to use footerClass, but now it is great!

                  • 6. Re: RichFaces 3.3.3 + dataTable + align footer
                    eldiegolp

                    In my opinion, if this is a feature, it isnt flexible at all. In my case, i use the css located at richfaces' jars, so, i hace to create my own css for this case.Having my entire column is center aligned, why cant the footer inherit that property ? I think it would be easier and much more flexible to allow the specificacion of the style to every facet of the column.

                    Thanks for the info on the style classes.