Nvm, After all these years, I was still completely unaware of @InjectContainer. Thanks.
On Mon, Oct 13, 2014 at 1:38 AM, George Christman <gchrist...@cardaddy.com> wrote: > I have a modal login box. When a user logs in through the login box, I > would like to reload a zone in the nav bar containing the user name which > is contained within the layout component. I've tried to use > @InjectComponent and call a method from within the layout component, but I > get > > *Unable to attach page sell/Index: Unable to inject component into field > layout of class com.cardaddy.auto.components.LoginRegister: Component > sell/Index:layout.loginregister does not contain embedded component > 'layout'.* > > > The code looks something like > > //html is the layout component > <html> > <t:zone t:id="loginNavZone>Hi ${name}</t:zone> > > <t:modaldialog> > <loginregister/> > </t:modaldialog> > </html> > > > public class LoginRegister { > > @InjectComponent > private Layout layout; > > public void onValidateFromLoginForm() { > layout.getLoginNavZone(); > } > } > > public class Layout { > public void getLoginNavZone() { > ajaxResponseRenderer.addRender("loginNavZone", loginNavZone); > } > } > > I know how to access a page using @PageInject from a component, but I can > not seem to access a component from within a component unless I declare the > component within the tml. Anybody know how to accomplish this? > -- > George Christman > www.CarDaddy.com > P.O. Box 735 > Johnstown, New York > > -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York