In my opinion, @InjectContainer is a bit fragile. I think you're much better off using the Environment or a component parameter. Let's consider a future case where you want to render the child component in a loop (or maybe an 'if' component). In this case the parent will be the loop/if and it won't work without refactoring. On 13 Feb 2015 19:11, "Thiago H de Paula Figueiredo" <thiag...@gmail.com> wrote:
> On Fri, 13 Feb 2015 16:44:52 -0200, Poggenpohl, Daniel < > daniel.poggenp...@isst.fraunhofer.de> wrote: > > Hello, >> why don't you try @InjectContainer? Or give the necessary information via >> parameters to the inner component? >> > > Yep, an @InjectContainer private Object parentComponent; field will give > you the parent component. You can change the field type and name, of > course. :) > > I agree 200% with Daniel: you should avoid manipulating the parent > component directly as much as possible, as you're coupling one component to > another, making the inner one just working when used inside a given other > component. > > You can pass information through parameters (recommended) or the > Environment service (when parameters aren't enough). > > Cheers! > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >