RE: table component
"Luke Galea" <[email protected]>
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
Funny.. I just went through that recently. I think that is the only way to do it.. at least the only way I could think of (modifying the Image component). I am curious, I have what I think is a common case: I want to have a column of check boxes (ie. To indicate which entries to delete ). Did you find that you needed to write a custom component for that as well? Or did you find a way of doing it using the base components? Thanks Luke Galea Software Development BlueCat Networks 905-762-5225 -----Original Message----- From: Joseph Panico [mailto:[email protected]] Sent: December 2, 2002 5:32 PM To: [email protected] Subject: [Tapestry-developer] table component 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 ------------------------------------------------------- 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