Hi,
Hmm.. I'm not a tomahawk developer (at least not recently), but it sure
looks like HtmlTableRendererBase will fail nastily if rows is ever
greater than the number of available elements in the data-list.
I don't remember it being this way in the past though I haven't checked
the old code. This class was significantly rewritten since the previous
tomahawk release, introducing at least one other nasty bug (related to
setting rowIndex).
If I'm right, then I would regard this as a bug; a rows value larger
than the dataset really should be handled more elegantly.
I presume you've got your data stored in a ResultSet; I suggest copying
this data into a normal list, then binding the "rows" attribute of the
table to a method that returns max(10, companyLst.size()) and seeing if
this works for you.
Regards,
Simon
Po Po wrote:
Hi,
I use tomahawk 1.1.3, when i use a t:datatable below
<t:dataTable id="data" value="#{testBean.companyList}"
var="company" rows="10">
<t:column>
<t:outputText value="#{company.companyID}"/>
</t:column>
<t:column>
<t:outputText value="#{company.companyName}"/>
</t:column>
</t:dataTable>
The companyList is contain data from table in database
(in my case, the table have 7 record).
The problem is in the tomcat console show an error
message like this:
11:37:47,484 ERROR HtmlTableRendererBase:243 - Row is
not available. Rowindex = 7
11:37:47,484 WARN HtmlResponseWriterImpl:225 - HTML
nesting warning on closing tbody: element tr rendered
by component : {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId:
/root/companyList.jsp][Class:
javax.faces.component.html.HtmlForm,Id:
mainForm][Class:
javax.faces.component.UINamingContainer,Id:
companyListId][Class:
org.apache.myfaces.component.html.ext.HtmlDataTable,Id:
data]} not explicitly closed
Then i view the html source, it rendered like below.
...
<table id="mainForm:companyListId:data">
<tbody id="mainForm:companyListId:data:tbody_element">
<tr><td>C001</td><td>CUSTOMER ONE</td></tr>
<tr><td>C002</td><td>CUSTOMER TWO</td></tr>
<tr><td>C004</td><td>CUSTOMER THREE</td></tr>
<tr><td>OW01</td><td>OWNER ONE COMPANY</td></tr>
<tr><td>V001</td><td>VENDOR ONE</td></tr>
<tr><td>V002</td><td>VENDOR TWO</td></tr>
<tr><td>V004</td><td>VENDOR THREE</td></tr>
<tr></tbody></table>
...
in the last line, the <tr> is not close properly.
But, when i change the value of attribute rows in
t:datatable into a value <= 7, there is no the error
and warn message in console. also the html table is
render correctly.
Anybody know what's wrong this?