Hi,

Am Dienstag, den 21.09.2010, 20:18 +0200 schrieb Radoslav Bielik:
> But I don't know how to get hold of the right element here - that
> would be the Grid that this mixin is tied to. I've tried using:
> 
>         @InjectContainer 
>         private Grid element; 
> 
> This way I can get a Grid instance but I don't really know how to get
> an Element instance from here.

I ran into the same problem a while ago. The problem is, that Grid does
not implement ClientElement and thus does not offer a getClientId()
method.
What I do is, I pass an id parameter to the Grid and to the mixin. This
way, the Grid renders its table with that id in the DOM and I can use
writer.getDocument().getElementById(id) in the mixin's @AfterRender
method.
Oh, and you'll probably want to check if the table has been rendered at
all as it usually isn't if the Grid's data source is empty, which can of
course easily be curcumvented by passing an appropriate "empty"
parameter that renders a table with the aforementioned id.
This is not really a nice approach but it works for me.

HTH,
Jochen


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

Reply via email to