Hats off to mindbridge-- this is a really well done component.

I have a question about embedding Tapestry components as the values (cell content) of the table. Specifically, I'm trying to embed Images into the table cells. It was fairly straightforward, since the Column just looks for an IRender to do the heavy lifting and all Tapestry Components are IRender. But I did have to trivially subclass Image to null out a couple of methods. That's because the standard Image implementation has expectations of how it will be used (namely, with Bindings looking for parameters) that weren't true the way I used it.

Basically, I put the IAsset for the Image in the DataModel. Then I have a simple TableColumn class:

public class PXImageTableColumn extends ExpressionTableColumn
{
...

public IRender getValueRenderer(IRequestCycle objCycle,
ITableModelSource objSource,
Object objRow)
{
IAsset aValue = (IAsset)this.getColumnValue( objRow);
Image aRenderer = new PXTableImage();

aRenderer.setImage( aValue);
return aRenderer;
}

and

public class PXTableImage extends Image
{
protected void prepareForRender(IRequestCycle cycle) throws RequestCycleException
{}

protected void cleanupAfterRender(IRequestCycle cycle)

{}
}

Is this the most straightforward path for what I'm trying to do?

thanks,

Joseph Panico
[EMAIL PROTECTED]



_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to