1 Reply Latest reply on May 7, 2009 7:07 AM by Ilya Shaikovsky

    rich:columns with seam not showing data (rendering blank dat

    Manish Prajapati Newbie

      Hi All,

      I am trying datatable with dynamic columns using rich:coulumns in seam.

      Following is my test.xhtml file :

      <ui:define name="main">
      <f:facet name="header">Test Data Table</f:facet>
      <rich:panel><f:facet name="header">Data Table </f:facet>
      <h:form>
      <rich:dataTable value="#{rowList}" var="tableObj" width="750">
      <f:facet name="header">
      <h:outputText value="Rules"></h:outputText>
      </f:facet>
      <rich:columns value="#{columnList}" var="colm">
      <f:facet name="header">
      <h:outputText value="#{colm.header}"/>
      </f:facet>
      <h:outputText value="#{tableObj[0]}"/>
      </rich:columns>
      </rich:dataTable>
      </h:form>
      </rich:panel>
      </ui:define>
      Following is my backing bean :

      @Stateless
      @Name("testManager")
      @Scope(ScopeType.SESSION)
      public class TestManagerBean implements TestManager {
      @Logger private Log log;
      @In FacesMessages facesMessages;
      @DataModel(scope = ScopeType.PAGE)
      List<Object[]> rowList;
      @DataModel(scope = ScopeType.PAGE)
      List columnList;

      @Factory("columnList")
      public void populateColumnList(){
      columnList=new ArrayList();
      columnList.add(new Column("First-Name"));
      columnList.add(new Column("Middle-Name"));
      columnList.add(new Column("Last-Name"));
      }
      @Factory("rowList")
      public void populateRowList()
      {
      rowList = new ArrayList<Object[]>();
      Object[] names1=new Object[] {"Test1,Test2,Test3"};
      Object[] names2=new Object[] {"Test4,Test5,Test6"};
      rowList.add(names1);
      rowList.add(names2);
      }
      @Remove
      public void remove() {
      // TODO Auto-generated method stub
      }

      My Column.java

      public class Column {
      private String header;

      public Column(String header){
      this.header=header;
      }
      public String getHeader(){
      return header;
      }

      public void setHeader(String header){
      this.header=header;
      }

      }

      My datatable is not displayed (or you can say its displying empty datatable).

      I suspect following reason because if i use rich:column it works fine (but it becomes static which i dont want):

      The <rich:columns> tag is initialized during components tree building process.
      This process precedes page rendering at "Render Response" JSF phase.

      Please tell me what 's wrong here.

      Thanks a lot in advance.

      Its urgent because i have already spent couple of days and didnt get any outcome.

      Regards,
      Manish