2 Replies Latest reply on Jan 17, 2012 9:52 AM by OÄŸuzhan Tortop

    Datatable fixed header

    Olivier Sabatier Newbie



      I need a datatable with a fixed header.

      I used rich:datatable because i also need group columns.


      And also, i can't chain an action(webflow) with the rowclick event. I tried a4j:ajax, a4j:jsFunction with no success.


      Anybody can help me ?





        • 1. Re: Datatable fixed header
          Mahesh Bonagiri Newbie

          Hi Sabatier,

          Welcome to the Community.

          here is the working code

          here is the working code, which will give you vertical scroll bar

          Xhtml code

          <rich:extendedDataTable value="#{test.dynamicList}" width="100px"
            height="350px" id="dynamicTable" enableContextMenu="false"
            var="fileData" reRender="dynamicScroller"
            noDataLabel="No records Founf">





          <a4j:support event="onRowClick"
                  <a4j:actionparam name="selRow" value="#{result.frmId}"
                   assignTo="#{test.selectedRow}" />


             <f:facet name="header">
              <h:outputLabel value="test header" />
             <h:outputText value="#{fileData}" />


          Managed bean code:

          import java.util.ArrayList;
          import java.util.List;

          import javax.faces.bean.ManagedBean;
          import javax.faces.bean.ViewScoped;

          @ManagedBean(name = "test")
          public class TestManagedBean {

          private List<String> dynamicList=new ArrayList<String>();



          private String selectedRow;
          public TestManagedBean() {
            for(int i=1;i<100;i++){
             dynamicList.add(" proeprty "+i);

            * @return the dynamicList
          public List<String> getDynamicList() {
            return dynamicList;

            * @param dynamicList the dynamicList to set
          public void setDynamicList(List<String> dynamicList) {
            this.dynamicList = dynamicList;