Hi folks!
I'm using the contrib:Table for the first time. I'm using the source and
columns parameters (and therefore not the tableModel parameter).
My source is a List of DOs, where each DO contains some fields (Date,
double, int, etc.) with getters.
--
Q1: My table does show up as expected, with the page navigation system.
But when I'm trying to change the page, I have this error:
Failure invoking listener method 'public void
org.apache.tapestry.contrib.table.components.TablePages.changePage(org.apache.tapestry.IRequestCycle)'
on [EMAIL PROTECTED]/resultsTable.tablePages]: 1
and that's an ArrayIndexOutOfBoundsException: 1.
I have a similar error when I'm trying to sort a column. It really does
sound easy to solve, but I'm stuck.
--
Q2: I have a column which displays a price. So quite naturally the field
in my DO is a double. I want a string in front of my double, so I
figured I needed to have a column with a custom ColumnEvaluator.
Something like this:
public ITableColumn getPriceColumn() {
SimpleTableColumn priceColumn = new SimpleTableColumn("priceId",
"Price", new PriceColumnEvaluator(), true);
return priceColumn;
}
private static class PriceColumnEvaluator implements
ITableColumnEvaluator {
public Object getColumnValue(ITableColumn objColumn, Object
objRow) {
DO row = (DO) objRow;
String output = row.getCurrency() + " " + row.getPrice();
return output;
}
}
However, I suspect my price sorting does not work anymore because now
the data type for my price column is a String (since my Evaluator
returns a String). I was not comfortable with doing this formatting
thing (adding the currency sign) in my evaluator in the first place,
since it was not "pure data" stuff. Would you have implemented it elsewhere?
Related to this, I will need another column in which I'll have to
display a little picture (which will be a link) and a few other things.
Is using a customColumnEvaluator the preferred way to do it?
Again, any hints appreciated.
/Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]