Thanks, that looks like a really good way to use DOM rewriting to alter grids.

However if I'm looking at it correctly I think that in 
GridCellDecorator.decorate I would still need to be able to set an Element's 
text, which I don't know whether it's possible.


-----Original Message-----
From: Lance Java [mailto:lance.j...@googlemail.com] 
Sent: Monday, July 21, 2014 13:52
To: Tapestry users
Subject: Re: Customizing the grid to alter its own content

You might be interested in this mixin

https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java

Unfortunately the demo site is down at the moment.

Sample usage:
https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/resources/org/lazan/t5/stitch/demo/pages/GridDecoratorDemo.tml

https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/java/org/lazan/t5/stitch/demo/pages/GridDecoratorDemo.java
 On 7 Jul 2014 13:39, "Davide Vecchi" <d...@amc.dk> wrote:

> Hello everybody,
>
> I would like to customize the Tapestry grid
> (org.apache.tapestry5.corelib.components.Grid) to make it change the 
> content originally provided in the source parameter, so that the 
> modified content is rendered in the grid instead of the original.
>
> As an example, I could make the grid abbreviate certain strings in a 
> certain way for columns that contain text, so that the abbreviated 
> text is shown instead of the original. This should be independent from 
> the specific data source provided by the specific page that is using 
> the grid: any grid from any page should render its content as abbreviated.
>
> I seem to see in the Grid code several options to try in order to 
> figure out how to implement this functionality, however before 
> starting making changes I'd like to know if there is a recommended, 
> Tapestry-friendly approach. And of course any related comment or suggestion 
> is always welcome.
>
> Thanks in advance
>

Reply via email to