Skip to main content
1-Visitor
May 20, 2010
Question

accessing the replaced element from an embedded xui dialog on windowload

  • May 20, 2010
  • 3 replies
  • 1101 views
Hello Adepters,

I've created an embedded xui dialog box that's a simple dropdown menu, and its purpose is to let the user set an attribute value on the replaced element.

When the dialog box is loaded, I want the dropdown to display the current value of the attribute. But I can't figure out how to access the replaced element from inside the WindowLoad event handler. I can access it from the domactivate event by using:

Application.event.view.window.ownerNode

But Application.event.view is undefined when I try to do that from the WindowLoad event.

Any pointers? This seems like it should be easy to do.

Thanks,

-James

    3 replies

    1-Visitor
    May 20, 2010
    Hi James,

    Try Application.event.target.ownerNode.

    In a WindowLoad handler, the Application.event.target is the window.

    Tung

    jsulak1-VisitorAuthor
    1-Visitor
    May 20, 2010
    Thanks, Tung. That's exactly what I was looking for.

    -James

    18-Opal
    May 20, 2010
    Hi James--

    Yes, you have to use a different approach to get the window handles
    inside windowload as opposed to domactivate.

    To get the dialog document (the XUI document underlying the dialog) in
    windowload, I have to use this:

    dlgdoc = Application.event.target.dialogView.document

    So, it might work for you to do something along these lines:

    docnode = Application.event.target.dialogView.window.ownerNode

    HTH

    --Clay