You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Heping Zhang <ph...@gmail.com> on 2007/05/31 00:58:48 UTC

an inner component want to get an outer component

hi, I have a login pane which embeded in a dojo dialog. And when login
successful, I want the dialog close. In my Login.java I wrote
    public void doLogin() {
    //...
            Dialog dlg = (Dialog)getComponent("loginDialog");
            dlg.hide();
    }

<div jwcid="loginDialog@Dialog" hidden="ognl:loginHidden" opacity="0.7"
backgroundColor="#cfe1ed">
    <div jwcid="@Login" />
</div>

Component $Login_160@c9ce633d[Home/$Border.$Header.$Login] does not contain
a component loginDialog.
What can I do then? Or can I do something to tell the outer I am success and
you handle other thing? Thank you.

Re: an inner component want to get an outer component

Posted by Heping Zhang <ph...@gmail.com>.
Thank you very much! It works well.

Re: an inner component want to get an outer component

Posted by Jesse Kuhnert <jk...@gmail.com>.
There are other ways but the proper way would probably be to make the Dialog
component a parameter to your login component so it can reference it as a
contained child.

On 5/30/07, Heping Zhang <ph...@gmail.com> wrote:
>
> hi, I have a login pane which embeded in a dojo dialog. And when login
> successful, I want the dialog close. In my Login.java I wrote
>     public void doLogin() {
>     //...
>             Dialog dlg = (Dialog)getComponent("loginDialog");
>             dlg.hide();
>     }
>
> <div jwcid="loginDialog@Dialog" hidden="ognl:loginHidden" opacity="0.7"
> backgroundColor="#cfe1ed">
>     <div jwcid="@Login" />
> </div>
>
> Component $Login_160@c9ce633d[Home/$Border.$Header.$Login] does not
> contain
> a component loginDialog.
> What can I do then? Or can I do something to tell the outer I am success
> and
> you handle other thing? Thank you.
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com