Hi george,
On phone.

@injectcontainer may give u access to layout to from your login refresh the
navbar zone.

http://tapestry.apache.org/injection-faq.html
On 13/10/2014 4:39 pm, "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
>

Reply via email to