Tomahawk datatable disaster

Spent 2 days to figure what went wrong with my t:datatable not displaying the updated list after submitting an action. It keeps on displaying old data (data before any action was performed).

My jsp:

styleClass = “resultTable”
cellspacing=”1″ cellpadding=”0″

<t:column headerstyleClass=”resultTableHeader”
styleClass = “resultTablePurpleLight textLeft” >

<h:selectBooleanCheckbox immediate=”true”

<h:inputHidden id=”errorId” value=”#{tie.errorID}”/>

<f:facet name=”header”>
<h:outputText value=”#{}”/>



After banging my head really hard on the wall (yeah right..), I managed to isolate the bug. It only happens when the list only contain one single item. And after googling around, I found a quick temporary solution!! Hooraaaah~~ I still don’t understand this bug. But the fixed shown in the mailing list is sufficient for now.

The magic part is the 2 lines shown in bold below. Whenever you iterate through a datatable, you need to set row index back to its original value.

My backing bean:

public void errorAction(String action) {
/* Save the current row index. */
int currentRowIndex = dataTable.getRowIndex();

for (int i = 0; i < dataTable.getRowCount(); i++) { dataTable.setRowIndex(i); ... } /* Restore the row index. */ dataTable.setRowIndex(currentRowIndex); }

Note: This application is using Tomahawk 1.1.6, JSF 1.1, running on Sun Application server 8.2.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>