1 Reply Latest reply on Aug 3, 2011 7:08 AM by Roger Gilliar

    Problem with extending UIExtendedDataTable

    Roger Gilliar Newbie

      So far I was able to register my own component and make it almost work. The problem I have now is that the table is not displayed correctly. The table borders are missing and I can not resize the columns or reorder them.

       

      I use the component like this:

       

      <cu:myDataTable

               rowClasses="lighTableRow,darkTableRow"                 

               value="#{overviewController.listOfData}" var="data" rows="11">

                            

               <rich:column sortBy="#{data.status}"

       

              ..

       

      @FacesComponent(value = "myDataTable")

      public class MyExtendedDataTable extends UIExtendedDataTable   {

       

        private static Log log = LogFactory.getLog(MyExtendedDataTable.class);

       

         public MyExtendedDataTable() {

             super();

             log.info("Created =========================================");

         }

       

         public static class ColumnIterator implements Iterator<UIComponent> {

       

          private Iterator<UIComponent> columns;

          int i=0;

       

          public ColumnIterator(Iterator<UIComponent> columns) {

              this.columns = columns;

          }

       

          @Override

          public boolean hasNext() {

              i++;

              // just for testing

              if (i > 4) {

       

                  return false;

       

              }

              return this.columns.hasNext();

          }

       

          @Override

          public UIComponent next() {

              return this.columns.next();

          }

       

          @Override

          public void remove() {

              this.columns.remove();       

          }

       

         }

       

         public Iterator<UIComponent> columns() {

             Iterator<UIComponent> cols = super.columns();

             return new ColumnIterator(cols);

         }

       

       

      }