[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: T5 Converting a T4 table to T5 grid
From:       "Daniel Jue" <teamphy6 () gmail ! com>
Date:       2007-07-29 23:02:25
Message-ID: 1a7ec2230707291602i748ff75fi452727ae38883a0d () mail ! gmail ! com
[Download RAW message or body]

Reading from some other threads about the Grid Component, it seems
that since it relies on the BeanModel, it would be unable to call the
methods that would return the data.
i.e for some column "foo" in row myrow,
It wants to call myrow.getFoo().  There is no way of telling it to
call myrow.get("foo");


On 7/27/07, Daniel Jue <teamphy6@gmail.com> wrote:
> I am converting some T4 code into T5.
> Maybe someone can point out the best way of doing this, while I contemplate it.
>
> In T4, there was a column definition string that you could pass to the
> contrib:table component.
> It would define the order and names of the columns.
>
> Since the number/type of columns in my T4 pages would not be known
> until compile time, I had the row object use a Map to hold the actual
> rows, with the column names as keys.
>
> My T4 page would then combine the column name strings and provide that
> to the contrib table.
>
> psuedocode looks like this:
>
> class myPage{
> List<fillableRow> list;
> }
>
> class fillableRow {
> Map<String columnName, FormattableDataItem celldata>
> }
>
> class FormattableDataItem<RAW,DISPLAY>(){
> RAW rawData = null;  //unadulterated data object, full precision, etc
> DISPLAY formattedData = null; //results from a Format.format() invocation.
> //getters and setters
> }
>
> I'm unsure of the proper way to inform the grid about how to acquire
> the columns from the rows, when the row object needs a column name to
> return the data.
>
> I think another reason I was doing this was so that I could assign
> comparators to compare against the raw types instead of the
> formatted-output types.  i.e. comparing Doubles versus comparing a
> monetary string "-$500.23"
>
> Any Ideas?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic