You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joel Trunick <Jo...@SmartPrice.com> on 2003/06/06 00:16:37 UTC

contrib:Table

In the Table example in the tutorial, how is the String in the column model
get interpreted as an OGNL expression?

Joel

Re: contrib:Table

Posted by Mindbridge <mi...@yahoo.com>.
Hi Joel,

    ExpressionTableColumn is a just a special table column that 'extracts'
the column value from the record using OGNL. You can see its documentation
at
http://jakarta.apache.org/tapestry/doc/api/org/apache/tapestry/contrib/table/model/ognl/ExpressionTableColumn.html

    As you have probably seen, the simplest usage is new
ExpressionTableColumn(<title>, <ognl expr>). For example, if the table
records are of type TimeZone, you could do
    new ExpressionTableColumn("Daylight Saving", "DSTSavings");
This will create a new Table column and will invoke getDSTSavings() on each
record to get the value to display in this column. OGNL is much more
powerful than that, of course, for full details see http://www.ognl.org/.

    This is just one column implementation, many others are possible if
necessary. The easiest way to do that is to define a new evaluator (see
ITableColumnEvaluator in the JavaDoc) and call setEvaluator() on the column
object.

I hope this helps.

Best regards,
-mb


----- Original Message ----- 
From: "Joel Trunick" <Jo...@SmartPrice.com>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Friday, June 06, 2003 1:16 AM
Subject: contrib:Table


>
> In the Table example in the tutorial, how is the String in the column
model
> get interpreted as an OGNL expression?
>
> Joel
>