You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dongmei Cao <do...@icann.org> on 2013/03/19 21:54:48 UTC

Renders 2 rows using the Grid component

Hi,

Is this possible? I'm using the Grid component. But I need to render 2 rows
per object from the source. For example, I have a list of Employees. I would
like to render one row to include the firstname, lastname and email, then
the second row with other details, such as, address, phone number, etc. When
the grid first loaded, only the first row will be displayed and the second
row will be hidden. When the user clicks on an Expand button in the first
row, the second row will also be displayed. Can this be done by the Grid
component? Or I need to use a different component?

Thanks in advance for any suggestions!

- D



Re: Renders 2 rows using the Grid component

Posted by Lance Java <la...@googlemail.com>.
You could also do this with a GridDecorator / GridRowDecorator 
http://tapestry-stitch.uklance.cloudbees.net/griddecoratordemo



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Renders-2-rows-using-the-Grid-component-tp5720560p5720566.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: Renders 2 rows using the Grid component

Posted by Dongmei Cao <do...@icann.org>.
Thanks for the trickery! I can definitely use it.

-----Original Message-----
From: Norman Franke <no...@myasd.com>
Reply-To: Tapestry users <us...@tapestry.apache.org>
Date: Tuesday, March 19, 2013 1:59 PM
To: Tapestry users <us...@tapestry.apache.org>
Subject: Re: Renders 2 rows using the Grid component

>You can do it, but it's a bit of a hack. I've taken two approaches:
>
>1. Have an extra column that's hidden where we add some special trickery
>or
>2. Define the last column with some extra trickery.
>
>Here is what I do for the trickery:
>
><t:parameter name="lastColumnNameCell">${row.lastColumnValue}
>    <t:outputraw value="literal:&lt;/td>&lt;/tr>&lt;tr>&lt;td colspan='2'
>class='contact'>" />${row.bonusColumn1}
>    <t:outputraw value="literal:&lt;/td>&lt;td colspan='6'
>class='notes'>" />${row.bonusColumn2}
></t:parameter>
>
>This is from an example with 8 columns and a second row with two columns.
>
>Norman Franke
>Answering Service for Directors, Inc.
>www.myasd.com
>
>
>
>On Mar 19, 2013, at 4:54 PM, Dongmei Cao wrote:
>
>> Hi,
>> 
>> Is this possible? I'm using the Grid component. But I need to render 2
>>rows per object from the source. For example, I have a list of
>>Employees. I would like to render one row to include the firstname,
>>lastname and email, then the second row with other details, such as,
>>address, phone number, etc. When the grid first loaded, only the first
>>row will be displayed and the second row will be hidden. When the user
>>clicks on an Expand button in the first row, the second row will also be
>>displayed. Can this be done by the Grid component? Or I need to use a
>>different component?
>> 
>> Thanks in advance for any suggestions!
>> 
>> - D
>

Re: Renders 2 rows using the Grid component

Posted by Norman Franke <no...@myasd.com>.
You can do it, but it's a bit of a hack. I've taken two approaches:

1. Have an extra column that's hidden where we add some special trickery or
2. Define the last column with some extra trickery.

Here is what I do for the trickery:

<t:parameter name="lastColumnNameCell">${row.lastColumnValue}
    <t:outputraw value="literal:&lt;/td>&lt;/tr>&lt;tr>&lt;td colspan='2' class='contact'>" />${row.bonusColumn1}
    <t:outputraw value="literal:&lt;/td>&lt;td colspan='6' class='notes'>" />${row.bonusColumn2}
</t:parameter>

This is from an example with 8 columns and a second row with two columns.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Mar 19, 2013, at 4:54 PM, Dongmei Cao wrote:

> Hi,
> 
> Is this possible? I'm using the Grid component. But I need to render 2 rows per object from the source. For example, I have a list of Employees. I would like to render one row to include the firstname, lastname and email, then the second row with other details, such as, address, phone number, etc. When the grid first loaded, only the first row will be displayed and the second row will be hidden. When the user clicks on an Expand button in the first row, the second row will also be displayed. Can this be done by the Grid component? Or I need to use a different component? 
> 
> Thanks in advance for any suggestions!
> 
> - D