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);
}
}
}
<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>
<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>