call functions in parent (?) of (?) window popup

I don't know the terms parent or window in flex 4.

I want to call functions in the parent of the parent window.

It seems to be difficult.

Help me please.

Thanks in advance.

========================== index.mxml ==========================
(root element: < mx:Application >-xmlns:mx = "http://www.adobe.com/2006/mxml")
a Main.mxml inside

========================== Main.mxml ==========================
(root element: < s:NavigatorContent >-xmlns:s = "library://ns.adobe.com/flex/spark")

public function functInMain (): void
{
do something
}
protected function dataGrid_itemDoubleClickHandler(event:ListEvent):void
{
var arr:ArrayCollection = event.currentTarget.dataProvider;

var titleWindowInstance:Popup =
Popup (PopUpManager.createPopUp (this,
Popup,
true));
titleWindowInstance.rowData = arr.getItemAt (event.rowIndex);
PopUpManager.centerPopUp (titleWindowInstance);
}

========================== Popup.mxml ==========================

protected function buttonClickedInpopup (): void
{

Application.application.parentDocument.functInMain (null); / / < <-here, I want to correct

}

Application.application appeal should work if the method you want to call is public.

There is also another way to do it: with a callback function.

In your pop-up:

private var _callbackFunction:Function;

public function set callbackFunction( value:Function ):void {
     _callbackFunction = value;
}

protected function buttonClickedInpopup():void {
     _callbackFunction(null);
}

And in your Main.mxml:

var titleWindowInstance:Popup = Popup(PopUpManager.createPopUp(this, Popup, true));
titleWindowInstance.rowData =  arr.getItemAt(event.rowIndex);
titleWindowInstance.callbackFunction = functInMain;
PopUpManager.centerPopUp(titleWindowInstance);

Tags: Flex

Similar Questions

  • region of refresh on the page parent after closing popup inframe

    Hello

    I have parent page with several regions, and one of the reports is related popup to another page using inframe. All these are works fine but now iam trying to a parent region partially regenerate after closing the window contextual inframe, I tried apex.submit (region1) but it does not work? no idea how can I update this after the closure of the window popup?

    Best regards and thank you

    Hi Gor_Mahia,

    Gor_Mahia wrote:

    Here are the details,

    application ID = 46268

    page ID = 13

    demo123/demo123

    proj2010 = workspace

    Use the links in the second column IR

    Once again thanks for your time.

    Check your application now. The interactive report is refreshing on the closure of the modal dialog box using the method of dynamic, such action described in the blog post:

    Monkey on Oracle: Modal popup with dynamic Actions

    Here are the changes:

    • Edited your action dynamic and value:

    In the section "Advanced":

    Scope of the event: Dynamics

    In 'true Actions:

    Action edited your "run the Javascript Code" and "Code" to modified:

    From:

    /* prevent default behavior on click */
    var e = this.browserEvent;
    e.preventDefault();
    /* Trigger JQuery UI dialog */
    var horizontalPadding = 30;
    var verticalPadding = 30;
    $('