Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Nicolas Bouillon
Following your advice, i've replicated the class CachingDataSource (from Grid class) inside my mixin, and created an instance of it using the BindParameter GridDataSource. @BindParameter private GridDataSource source; @OnEvent(value = EXPORT_EVENT) public StreamResponse export() { CachingDat

Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Can you include your template? Perhaps the two components are not within the same heartbeat. Depending on your use case, you might need a container component to invoke a method on a child at some later stage. Take a look at parallel / parallelContainer for inspiration http://t5stitch-lazan.rhclou

Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Possibly a much simpler option is to explicitly provide a clientId

Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Lance Java
The initial render of the grid occurs on a different request to the "export" event. Tapestry does not maintain state between requests (unless you explicitly @Persist which i wouldn't recommend). Therefore it's perfectly reasonable for the GridDataSource to be invoked once for the initial html rend

Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Nicolas Bouillon
2015-05-20 11:08 GMT+02:00 Lance Java : > The initial render of the grid occurs on a different request to the > "export" event. Tapestry does not maintain state between requests (unless > you explicitly @Persist which i wouldn't recommend). > Of course, that is well understood. The grid is not (a

Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Lance Java
As you've discovered... Tapestry replaces field access with Binding.get() using plastic byte code magic. You can use a local variable to avoid multiple gets. Eg: @BindParameter private GridDataSource source; ... GridDataSource sourceCopy = source; doStuff(sourceCopy); doMoreStuff(sourceCopy);

Re: Tapestry5 : URL Re-writing : Pass parameters to transformPageRenderLink method

2015-05-20 Thread Pratik Patel [C]
I could fixing my issue the other way thanks to Lance Java. It can be found here. http://stackoverflow.com/questions/30259617/tapestry5-url-re-writing-pass-parameters-to-transformpagerenderlink-method/30263687#30263687 - To uns

Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Thiago H de Paula Figueiredo
On Wed, 20 May 2015 10:11:34 -0300, Lance Java wrote: As you've discovered... Tapestry replaces field access with Binding.get() using plastic byte code magic. You can use a local variable to avoid multiple gets. Or annotate the getter with @Cached. :) Eg: @BindParameter private GridData

Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Ilya Obshadko
Thanks, that's helpful. I think that 'two components not in the same heartbeat' is really the reason, however I don't quite understand how to make them work in the same heartbeat and if that's even possible. Both components are rendered inside a zone, and the second one is a Bootstrap Affix, whic

Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Can you generate the clientId yourself and pass as a parameter into both components? Why do you need to know the clientId? If it's for a javascript selector can you use a data- attribute instead?

Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Ilya Obshadko
Yes, I've finally resorted to data attributes. I wanted Tapestry-generated client ids for consistency, but it works either way. On Wed, May 20, 2015 at 7:38 PM, Lance Java wrote: > Can you generate the clientId yourself and pass as a parameter into both > components? > > Why do you need to know