You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Giaccone, Anthony CTR DTIC-A" <AG...@DTIC.MIL> on 2006/12/15 03:19:11 UTC
Contrib Table with IBasicTableModel and DB
I'm trying to use the Table component. Behind the Table, I've
implemented an IBasicTableModel to provide the data. In that class, I
pass in a DAO and a partially filled out object (data in the object is
obtained from a form).
In the My implementation of IBasicTableModel, when the getCurrentRows
method is called, I use the information passed in to call a method on
the DAO to fetch the data to fill that table with data.
On return the data attribute contains a Collection. I then take the
Collection, get it's Iterator, and return that. The full code is here:
public Iterator getCurrentPageRows( int nFirst, int nPageSize,
ITableColumn objSortColumn, boolean bSortOrder)
{
data = null;
String columnName = (objSortColumn != null) ?
objSortColumn.getColumnName() : "";
if (getUserDAO() != null)
{
data = getUserDAO().findLikeItemInRangeSorted(likeItem,
nFirst, nPageSize,
columnName, bSortOrder);
}
return (data != null) ? data.iterator() : new
ArrayList().iterator();
}
My problem is that sometimes, when the table renders, there are cells
and occasionally rows that don't render.
I get error messages like this:
org.apache.tapestry.contrib.table.model.ognl.OgnlTableColumnEvaluator
getColumnValue
SEVERE: Cannot use column expression 'iacOffice' in row
When that happens what I get looks like this <td></td>, not this
<td> </td>
In some cases I lose whole rows, <tr></tr>
Can anyone suggest what's going wrong here?
Tony
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org