2 Replies Latest reply on Feb 26, 2016 7:48 AM by auston

    static data in rich:dataTable

    shandor

      Hi,

       

      Is it possible to use static data ( data which is not a result of iteration over a collection ) in a data table ? like so:

       

      <rich:dataTable border="0">
           <rich:column rowspan="2">
                <rich:spacer />
           </rich:column>
           <rich:column colspan="3">
                <h:outputText value="Expenses" />
           </rich:column>
           <rich:column rowspan="2">
                <h:outputText value="subtotals" />
           </rich:column>
           <rich:column breakBefore="true">
                <h:outputText value="Meals" />
           </rich:column>
           <rich:column>
                <h:outputText value="Hotels" />
           </rich:column>
           <rich:column>
                <h:outputText value="Transport" />
           </rich:column>
      </rich:dataTable>
      
      

       

      BTW, the above code will render an empty table.

      BTW!, this will work correctly if put in the header facet.

       

      Thanks.

      Adi

        • 1. Re: static data in rich:dataTable
          akaine

          If I understand correctly the only "static" data that can be rendered in a dataTable are column headers (set through facets, as you mentioned). The data is iterated always. If you want some fixed values, fill your list variable with some static data manually prior to rendering the table.

          • 2. Re: static data in rich:dataTable
            auston

            Its not possible! but if what you want is visual identical table, there is a way:

            
            
            
            
                    <rich:dataTable></rich:dataTable> <!-- necessary for jsf load richt faces css style on this page  -->
            
            
            
                            <table id="tblconfiguracao" class="rich-table">
                                <thead class="rich-table-thead">
                                    <tr class="rich-table-header"  >
                                        <th class="rich-table-headercell">Descrição</th>
                                        <th class="rich-table-headercell">Ação</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="rich-table-row">
                                        <td class="rich-table-cell ">Para otimizar a experiência de uso desse sistema, alguns dados do SRH são copiados temporariamente. Essa ação irá dispensar qualquer copia de dado do SRH o que forçara a recuperação de dados mais atuais.</td>
                                        <td class="rich-table-cell "><a4j:commandButton id="btLimparCache" value="Atualizar do SRH" title="Obter dados atualizados do SRH." action="#{parametroAction.limparCache()}"/></td>
                                    </tr>
                                </tbody>
            
            
            
                            </table>