Thanks Robert that all makes sense to me. Had a funny feeling I was going to 
run up against TAP5-103 again on this one ;-)

Regards, Alfie.

-----Original Message-----
From: Robert Zeigler [mailto:robe...@scazdl.org]
Sent: Mon 06/07/2009 18:18
To: Tapestry users
Subject: Re: Mixin to grid component - adding columns
 
This is an interesting idea, although I'm not sure if it will work  
(see point #2)

1) you want to use:

grid.getDataModel().add("mynewcolumn",null);

which will inform the data model that you're adding a column that  
doesn't correspond (directly) to a property.
Alternatively, you can provide a PropertyConduit implementation  
instead of null.

2) Mixins can't use tml.  This will complicate things a bit because  
the grid is going to look for a way to render the column and not find  
it... but I wonder if there's a way get around this.
Certainly, your page or component's tml file could define the  
appropriate parameter block, but, that's a bit silly since it  
basically defeats the point of the mixin.
What you /might/ be able to do is define some sort of "MixinBlocks"  
page that your mixins all use to define their blocks.  Certainly, you  
can do that and delegate rendering to a block in any arbitrary page  
normally... the trick comes in hooking this block up for Grid.

Grid provides an "overrides" parameter that would let you do the  
trick, except... there's really not any way for you to specify it from  
within the mixin, yet. https://issues.apache.org/jira/browse/TAP5-103  
would help a lot, but I'm still exploring the best way to implement  
this.
In the meantime, perhaps you could create a custom implementation of  
PropertyOverrides that you supply to the grid whenever you're using  
the mixin.  It's a little ugly that you have to specify this, but at  
least the logic could then be encapsulated in a single place.  This  
implementation would need to lookup up the block in the page/grid, as  
well as any other appropriate locations (a MixinBlocks page, for  
instance).  Probably the simplest implementation would extend the  
current PropertyOverridesImpl implementation and take the grid  
component resources as input, but do a search first within any other  
"special" pages (MixinBlocks, etc.), then fallback to searching the  
grid parameters.

HTH,

Robert


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

Reply via email to