Hi Martin,
Is it possible to include the xml/html that define the Table component?
Without that information it is a bit hard to see what is going on.
In addition you might want to check my answer to the recent message
"Table Model Question" from Nicholas Skriloff.
Best regards,
-mb
Martin Carel wrote:
Yes I did check those examples out. And indeed they were useful. And I
still have problems.
This morning I realized I had forgotten to put my source's data
property persistent in the session.
And bumped into another problem. Now I don't even see my table on the
first load, but have this exception:
Either the tableModel parameter or both source and columns parameters
must be specified by component Results/resultsTable.tableView
This issue has been discussed on this mailing-list, but I couldn't
find a solution to my problem so far :(
My source is in an object called dOsList of type java.util.List.
I lazy-initialize this object in its getter method.
Thus my pageBeginRender() method is empty (the dOsList being null on
first load is handled by the getter).
I have in my page specification <property name="dOsList"
persist="session"/>
So that in my HTML template I have: source="ognl:dOsList" for my table
component.
I know (with the debugger) that my getDOsList() on my page is *not*
called. I just can't figure out why.
I can also see from the Tapestry exception page that my dOsList
property is not stored in the session.
I call it a bad day. Any thoughts?
/Martin
Daniel Lydiard wrote:
Have you tried looking at these examples yet?
https://tapestrywebcomponentexamples.dev.java.net/
(https://tapestrywebcomponentexamples.dev.java.net/files/documents/2449/8568/TapestryTables.war)
There are a lot of help...
----- Original Message ----- From: "Martin Carel"
<[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Thursday, February 02, 2006 1:58 AM
Subject: contrib:Table : advices requested
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]