0 Replies Latest reply on Dec 12, 2007 3:44 AM by sebgerpb

    Custom HtmlColumn

    sebgerpb

      Hi guys,

      I have a datatable which is built dynamically. For the table, I need to store additional information for each column. So I created my own HtmlColumn class which extends HtmlColumn:

      public class MyHtmlColumn extends HtmlColumn {
      
      public MyHtmlColumn() {
      super();
      }
      
      private void someObject columnData;
      
      ...+getters&setters...
      }
      


      Somewhere in my methode for building the datatable I do the following:
      private MyHtmlColumn column = new MyHtmlColumn();
      column.setColumnData(someColumnData);
      ....some more operations on the column...
      dataTable.getChildren.add(column);
      


      I use this column class for adding columns to my datatable. This works almost fine. The table is being displayed correctly. When I click on a link in the datatable, I can retrieve the column in which the clicked link is displayed (via an ActionListener). I then cast the retrieved column to MyHtmlColumn, which works fine also. But the columnData attribute of the column is null, although I filled it before.

      Am I missing something? It seems to me like JSF swallows my custom attribute in MyHtmlColumn when the table is rendered, so I can't access it afterwards. Does anyone have an idea for this?