11 Replies Latest reply on Apr 7, 2011 10:26 AM by danger21

    richdataTable : Header in every row

    danger21

      Hi all, I want to implement datatable in witch headers will be in every row, could anybody help me?

       

       

      Header 1value (not header, defult row color)
      Heder2
      value
      Header 2
      value
      Header 3value
      Header 3
      value
      Header 4
      value

      value

      value
      ...


       

      I tried this way, but it doesn''t works:

       

      <rich:dataTable width="100%" style="margin-top:10px;"

                                          var="pctItem" value="#{pctForm.pct}">

       

                                          <rich:columnGroup>   

                                                  <rich:column>  

                                                       <f:facet name="header">

                                                            <h:outputText value="header1"/>  

                                                       </f:facet >

                                                  </rich:column>       

                                              <rich:column>

                                                  <h:outputText value="value1"/>

                                              </rich:column>

                                                       <f:facet name="header">

                                                            <h:outputText value="header2"/>  

                                                       </f:facet >

                                              <rich:column>

                                                  <h:outputText value="value2"/>

                                              </rich:column>

                                          </rich:columnGroup>

      ..........

      </rich:dataTable>

        • 1. richdataTable : Header in every row
          iabughosh

          Hi V.V,

          you can use rowKeyVar attribute of dataTable :

           

          <rich:dataTable id="table"

                                  value="#{table.tableData}"

                                  var="record"

                                  rowKeyVar="var">

                                                  <rich:column>

                                                                 <f:facet name="header">

                                                                                <h:outputText value="Header 1" />

                                                                 </f:facet>

                                                                 <h:outputText value="Header #{var + 2}" />

              </rich:column>

          </rich:dataTable>

          • 2. Re: richdataTable : Header in every row
            danger21

            I thinck you dont't understand, problem is not in Header value numbering, I want to have header in first column and in third(with corespondent header style)

            • 3. richdataTable : Header in every row
              iabughosh

              can you give us an example with obvious data ?.

              • 4. richdataTable : Header in every row
                danger21

                I have problem in styling,  element inside <f:facet name="header"> have specific styling and I want to apply this styling on whole thirst column and on third, like i mentioned.

                • 5. richdataTable : Header in every row
                  iabughosh

                  ok, you can use the element style of rich:column, ex :

                  <rich:column style="color:red">

                                                                    <f:facet name="header">

                        <h:outputText value="Header 1" style="color:blue"/>

                                                                    </f:facet>

                                                                    <h:outputText value="Header #{var + 2}" />

                  </rich:column>

                   

                  and you can apply the style to the child elements of facet="header".

                  • 6. richdataTable : Header in every row
                    danger21

                    style="color:red" changes only letters color, how I can change background?

                    • 7. richdataTable : Header in every row
                      iabughosh

                      you can use style="background:red".

                       

                      regards.

                      • 8. richdataTable : Header in every row
                        ilya_shaikovsky

                        use styleClass="rf-dt-shdr-c" on every column.

                        • 9. richdataTable : Header in every row
                          danger21

                          <rich:column styleClass="rf-dt-shdr-c">   doesn't change nothing

                          • 10. richdataTable : Header in every row
                            ilya_shaikovsky

                            that's probably because you using 3.3.x and I thought about 4.x under 4.x it works fine.

                             

                            But for 3.3.x there were other names for css classes.. So should be:

                             

                            <rich:dataTable value="#{capitalsBean.capitals}" var="cap" id="table" rows="20" rowClasses="rich-table-subheader">

                            <rich:column styleClass="rich-table-subheadercell  ">

                            • 11. richdataTable : Header in every row
                              danger21

                              Thanks for help!