On Thu, 28 Jun 2012 06:56:23 -0300, ffred <ffre...@gmail.com> wrote:

Hello,

Hi!

But now that i've put it directly in the .tml of my layout, it just doesn't work anymore and ends logically with something like "FeedBack is not present in the component template".

That's correct. A component instance belongs to where it was declared and only the page or component that declared it has direct access to it.

I've imagined multiple way to correct that :
- Use a intermediate pojo "FeedbackData"
- Include the layout itself and use a myLayout.getFeedbackComponent() getter

Maybe those solution will works but i'm looking for a best practice here.
I guess it's quite a common problem so there must be a "tapestry spirit"
solution for it.

You're already using the "Tapestry solution" for it. The components inside a page or component are part of their internal structure, so, in a very OOP fashion, they're not directly accessible. Think of them almost as private fields in a Java class.

Well, the really really Tapestry way would be even avoid the solution above if possible and use some other way, typically events or the Environment, to pass information from bottom (component) to top (the component or page that uses that component, recursively).

--
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