On Wed, 28 Nov 2012 21:22:09 -0200, Robert Hailey <rhai...@allogy.com> wrote:

Unless I'm mistaken (which is possible), tapestry will create two distinct components when building the component trees, and they will not have access to the same variable.

So a template like:
<html ...>
        <t:widget/>
        <t:widget/>
        <t:widget/>
</html>

Would yield three log messages of "rendered 1 time".

Yep, you have three instances of the widget component. If you need to share data between them, why don't you pass the page property to all them? The prop binding is bidirectional (read and write), so, if one of the widget instances change the value of the parameter field, it will change the bound property too.

Again, that's why we ask everyone to say what they want to do instead of just asking "how to use XXX", because sometimes XXX isn't the best option for what they want to do. ;)

Another option, maybe even more recommended than that, is to put this shared per-thread state inside a per-thread service. I think this is the easier, cleaner, more organized solution.

--
Thiago H. de Paula Figueiredo

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

Reply via email to