0 Replies Latest reply on Mar 5, 2008 11:16 AM by Stefano Maestri

    Rendering of UIDataTable subclass

    Stefano Maestri Expert

      I have some trouble with the rendering of a data table. To change the default behavior of UIDataTable I subclassed it. Here is the code of the subclass:

      public class CustomDataTable extends UIDataTable {
       public static final String COMPONENT_TYPE = "it.lince.lego.seam.ui.CustomDataTableComponent";
       private Log log = Logging.getLog(this.getClass());
       public String getFamily() {
       return super.getFamily();
       }
       public void encodeBegin(FacesContext context) throws java.io.IOException {
       super.encodeBegin(context);
       if (this.getFirst() > this.getRowCount()) {
       this.setFirst(0);
       }
       }
      }
      


      I used this component in my view and it behaves like expected, but the generated markup is differend from what I expect it should be. Note that the used skin is set to "classic".

      So, insted of
      <table id="UserDB:historicalUserDBItems" class="dr-table rich-table" width="700" rules="all" cellspacing="0" cellpadding="0" border="0" style="border: 1px solid rgb(217, 217, 217);">
      <colgroup span="6">
       ...
      </colgroup>
      <thead>
       ...
      </thead>
      <tbody>
       ...
      </tbody>
      </table>
      


      I got

      <table width="700" rules="all" cellspacing="0" cellpadding="0" style="border: 1px solid rgb(217, 217, 217);" id="UserDB:historicalUserDBItems">
      <thead>
       ...
      </thead>
      <tbody>
       ...
      </tbody>
      </table>
      


      I suspect that the used skin for CustomDataTable is different from "classic". Am I right? There is any way to set the right skin to render my custom component? Any other suggestions?

      Thans in advance.