Call functions in parent(?) from popup window(?)

I'm not sure the terms parent or window in flex 4.
I want to call functions in parent from parent window.
it seems to be hard.
Help me please.
Thanks in advance.
========================== index.mxml ==========================
(root element : <mx:Application> - xmlns:mx="http://www.adobe.com/2006/mxml")
has Main.mxml in it
========================== 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

Thanks.
Your callback function works ok
why calling public functin won't work?
here are neet examples.
index.mxml : front page
SearchEvents.mxml : inside index.mxml
UpdateEvent.mxml : poped up from SearchEvents.mxml
========index.mxml===========
<?xml version="1.0" encoding="utf-8"?>
<mx:Application pageTitle="CA Management"
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:i="test.*"
    width="100%" height="100%" creationComplete="application1_creationCompleteHandler(event)" >
<mx:Script>
  <![CDATA[
   import mx.events.FlexEvent;
   protected function application1_creationCompleteHandler(event:FlexEvent):void
    myViewstack.selectedIndex = 0;
  ]]>
</mx:Script>
<mx:ViewStack width="100%" height="100%" id="myViewstack">
    <s:NavigatorContent id="EventManagement" label="Event Management"><i:SearchEvents x="0" y="0"/></s:NavigatorContent>
</mx:ViewStack>
</mx:Application>
========SearchEvents.mxml=========
<?xml version="1.0" encoding="utf-8"?>
<s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
     xmlns:s="library://ns.adobe.com/flex/spark"
     xmlns:mx="library://ns.adobe.com/flex/mx" 
     x="113" y="163"  
     height="100%" width="750">
<fx:Script>
  <![CDATA[
   import mx.collections.ArrayCollection;
   import mx.controls.Alert;
   import mx.events.FlexEvent;
   import mx.events.ListEvent;
   import mx.managers.PopUpManager;
   import mx.rpc.events.ResultEvent;
   public function parentFunction(param:String):void{
    Alert.show("parent function called with " + param);
   protected function btnSearch_clickHandler(event:MouseEvent):void
    var titleWindowInstance:UpdateEvent =
     UpdateEvent(PopUpManager.createPopUp(this,
      UpdateEvent,
      true));    
    PopUpManager.centerPopUp(titleWindowInstance);
  ]]>
</fx:Script>
<s:Button x="637" y="70" label="Popup" id="btnSearch" click="btnSearch_clickHandler(event)"/>
</s:NavigatorContent>
========UpdateEvent.mxml=====
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:incl="incl.*"
    showCloseButton="false"
    title="Update Event" width="432" height="500"
    xmlns:subscription="services.subscription.*"
    xmlns:core="services.core.*"
    horizontalAlign="left" xmlns:vo="vo.*"
    >
<fx:Script>
  <![CDATA[
   import mx.core.Application;
   protected function parentFunctionCall(event:MouseEvent):void
    Application.application.parentFunction("param from popup");
  ]]>
</fx:Script>
<fx:Script>
  <![CDATA[
   import mx.collections.ArrayCollection;
   import mx.controls.Alert;
   import mx.controls.dataGridClasses.DataGridColumn;
   import mx.core.Application;
   import mx.events.FlexEvent;
   import mx.formatters.*;
   import mx.managers.PopUpManager;
   import popup.*;
   [Bindable] public var rowData:Object ;//to get the parent row
  ]]>
</fx:Script>
<s:Button label="parentFunctionCall" id="btnPar" click="parentFunctionCall(event)"/>
</mx:TitleWindow>

Similar Messages

  • How to call method of parent in popup window

    i hav one.mxml file which consist of getData() method
    and two.mxml which is popup window having one button i want to call getData() method on button click.
    waiting for reply.

    Usually you would dispatch an event and parents will listen for certain events.
    If you are dispatching an event yourself, you can set it to bubble up all the way so whoever is interested will act upon.
    In your case, the button click will generate MouseEvent with type of MouseEvent.CLICK.
    All you need to do is listen for it.
    private function showPanel():void {
         var dlg:Panel = new Panel();
         var btn:Button = new Button();
         dlg.addChild(btn);
         dlg.width = 300;
         dlg.height = 200;
         dlg.addEventListener(MouseEvent.CLICK, sayHello, true);
         PopUpManager.addPopUp(dlg, this, true);
         PopUpManager.centerPopUp(dlg);
    private function sayHello(event:MouseEvent):void
         trace("button in panel clicked");

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • Calling Transaction Launcher in custom popup window

    Hello Experts,
    I am facing a issue. I have to call transaction launcher in custom popup window.
    It is working when i am calling transaction launcher in main window. but it is not working when i am trying to call transation launcher in popup window.
    I have written the code to call the transaction launcher in DO_PREPARE_OUTPUT method of popup view.
    Please let me know do i need to do anything extra? I am using CRM 6.0.
    Thanks in Advance
    Rajeev Singh.
    Edited by: Rajeev Singh on Feb 9, 2012 1:08 PM

    Hi Manas,
    I implemented a PopUp component some time ago for this task. There was a tutorial written for something similar here on SDN the link is: https://wiki.sdn.sap.com/wiki/display/CRM/OpeninganURLthroughpop-upfromWEBUIofCRM2007
    In the PopUp you do a followup navigation to the transaction you would like to call:
    data: lr_navigation       TYPE REF TO         if_crm_ui_navigation_service.
    lr_navigation = cl_crm_ui_navigation_service=>get_instance( me ).
      lr_navigation->navigate( iv_link_id         = 'your_logical_link'
                               iv_data_collection = lr_col ).
    lr_col is a BOL collection of any kind of navigational data you need, can be kept empty as well.

  • Update cfdiv in Parent Window from popup window

    I need help trying to update a cfdiv in the parent window
    from a popup window.
    The parent window displays a color (red by default)
    The popup gives you a radio selection which would let you
    select a different color.
    I need to have this submit button update the cfdiv called
    "main" in the parent window by lby displaying the corresponding
    color AND I want this window to hide.

    <!--- POPUP.CFM --->
    <cfif NOT structkeyexists(form, 'color')>
    <cfform action="popUp.cfm" method="post" name="form1">
    <cfinput type="radio" name="color" value="red"
    required="yes">Red
    <cfinput type="radio" name="color" value="blue"
    required="yes">Blue
    <cfinput type="radio" name="color" value="green"
    required="yes">Green
    <br />
    <cfinput type="submit" name="submit" value="submit">
    </cfform>
    <cfelse>
    <script type="text/javascript">
    updateColor(<cfoutput>'#form.color#'</cfoutput>);
    </script>
    </cfif>
    <!--- MAIN PAGE --->
    <!--- Add this js function to the HEAD section of the
    page: --->
    <script type="text/javascript">
    updateColor = function(color){
    document.getElementById('main').innerHTML = color;
    ColdFusion.Window.hide('mywindow');
    </script>
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • How to pass the values from popup window to parent's window

    Hi Experts,
    in my application i need to develop one popup window in that i have created 4 dropdowns and one ok button , if i willl click on that ok  button the values should pass to parent window dropdownlistboxes
    can any body suggest how i will get the popup window values
    thanks in advance,
    ramani.

    Hi Ramani,
    I can provide few inputs on how can we control JSP 2 from JSP1.
    Here is the code. Check if you can convert this to make useful to you. I am not passing values but control.
    here it is:
    JSP 1.
    <h1>Page One</h1>
    <br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>.html#part1">part 1</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part2">part 2</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part3">part 3</a>
    JSP 2.
    <h1>Page Two</h1>
    <br>
    <a name="part1">
    <h3>Part 1</h3>
    </a>
    <a name="part2">
    <h3>Part 2</h3>
    </a>
    <a name="part3">
    <h3>Part 3</h3>
    </a>
    This way you can move from one JSP to other.
    regards
    -Kedar Kulkarni
    reward points if useful.
    Message was edited by:
            Kedar Kulkarni

  • How to send data from popup window to parent window

    Hi,
    I need help some like this
    I have parent window ,in that i am clicking + button one dynamic row should add and one popup window has to diplay .Popup window contain 3 comboboxes and 5 text boxes. Once i am clicking OK button in popup window those values has to display at specified row in parent window
    Kindly help me ,
    Thanks
    jyothi

    See this
    http://www.oracle.com/technology/products/jdev/101/howtos/jsfdrilldown/index.html

  • How to pass field value from popup window to oninput processing of other pg

    Hi,
    I want to pass a field value from the popup window to oninput processing of main page ( from where popup window is triggered). and need to close the popup window. How to do it ?
    In the popup window's oninputprocessing, im doing some validation checks. If it passes all the validations, then only the control shd come to main page ..else it should stay in popup window only .
    Regards,
    Jothi.

    Hi Jothi,
    you can use java script to pass the value and close your popup window. use the following code.
    in your popup window:
    function passData(h1)
             window.opener.document.getElementById('var1').value = h1 ;
             window.close();
    then call this function when you finish your validations.
    in your main page layout create an input field with id as passed in the function above "var1".
    In the value attribute give it your variable as follow:
    <htmlb:inputField id      = "var1"
                              value   = "<%= var2 %>"
                              visible = "false" />
    "var2" will be assigned the value from your popup window.
    I hope this will help you..
    Regards,
    Husain

  • Call function or class from a loaded MC

    Hi,
    Can anyone tell me if its possible to call a function or class from within a loaded MC?
    mainMovie loads MC > MC calls function in a class of mainMovie
    if so, what is the best method?
    I've tried this from loaded MC but (of course) an error pops:
    movieClip(parent.parent).DO_THIS();
    Thanks for any "light" on this.

    It works fine!
    I'll try now to "sniff" into some class in main movieClip...
    Thanks

  • Phone call saying they were from Microsoft Windows

    I received a phone call today from a man that said he was from Microsoft Windows, & that Microsoft had been receiving notices for several weeks that " something" was wrong with my computer.  Offline he had me do a system check, then said my computer
    was corrupted, then put on his floor supervisor who had me get online and do some more system checks and told me that I was corrupted and it would cost $150-$350 to fix. I hung up thinking this might be a scam.  My question is do you have someone who
    makes these type phone calls, or was it a scam? If it is corrupted how do I fix it.
    Thanks for your help
    [email protected]

    Hi, I also had a phone call from someone who claimed they were from the microsoft team and were having warnings suggesting that my computer had serious issues.  When I asked which computer they said the one with windows 7.  After a long phone call
    and they even went onto my computer remotely without asking for my permission showed me severial files which they classed as hackers trying to get into my information which can be corrected at a cost of £89.  When I told them I was not interested as the
    computer was only a cheap note book for the kids to use, I was put onto someone else for them to convince me that now all computers used in the home are now effected.   It came to an end with me hanging up on them.  If anybody out there is interested
    into investigating this, the company who is doing this is: BC Repair and Services, and claim to be microsoft authorised services.  Tel number:020390105670.
    Hope this can help,
    Ian

  • Calling PL/SQL procedures from a Windows CMD script

    Hello,
    I am writing a Windows CMD script. From this script I want to call procedures from a PL/SQL package which selects, inserts or deletes rows from the database.
    How do I go about logging into the database from the cmd script and calling PL/SQL procedures from there?
    Does anyone have any examples of such scripts? Thanks in advance.

    No, it is not a job that needs to be scheduled.
    The script will be used when needed to select info from a certain table and also to insert or delete certain info into/from this table (so, it is just simple sql statements which I have put into a package), but I'm sure how to log into the database and execute the procedures from this package in a cmd script.

  • Remove Maximize button from popup window using Webdynpro ABAP

    Hi,
    Is there a way to remove the maximize button from a popup window using Webdynpro ABAP?
    Thanks,
    Jay

    Hi Jayanth,
    I think by setting is_resizable parameter pass abap_false. try this
    lo_window = lo_window_manager->create_window(
    window_name = 'POPUP'
    title = 'Window'
    close_in_any_case      = abap_true
    message_display_mode = if_wd_window=>co_msg_display_mode_selected
    message_type = if_wd_window=>co_msg_type_none
    is_resizable    = ABAP_FALSE ).
    Cheers,
    Kris.

  • Removing title bar from popup window

    Hi ,
    I have created an popup window and I have to remove the title bar of that window completely(either to make the title bar invisible or to remove the title bar completely).
    I have tried the following method but of no use,
    1)window.removewwindowfeature.
    Please provide solutions.
    Thanks,
    Mahesh

    Hi Mahesh,
    Just try this out, it will resolve your issue.
    [WebDynpro Popup Window|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3]
    Regards,

  • Calling function of JavaScript from  jsp code

    I ve to call one jsp page from other so I need to call another page
    I m trying to do by writing a javascript code for submitting the page

    while redirecting the page when I am using
    request.getParameter of hidden objects in the
    previous page its not giving the correct valuesA redirect is different from a submit, in the sense that it will create a new Request object.
    If you want to pass parameters to the next page, you will have to pass them as part of the url:
    response.sendRedirect("http://myserver/mypage.jsp?param1=value1&param2=value2");And then in mypage.jsp, you can do:
    String value1 = request.getParameter("param1");

  • RFC - Calling Function Module in a local Windows Program (.exe) on user PC

    Hi Gurus !
    Has anyone ever tried to call a local program on the user side through RFC ? Actually, this programme should allow the use of function module from ABAP programs.
    Indeed we want to use some device locally installed, here a device to pay using Credit Cards.
    However, we've almost successfully filled our requirements if the destination RFC is activated as a Registered Program. But a user B tries to access device of a user A if the code and destination are the same. So we need to create as many RFC destination as users.
    So, we'd like the frontGUI to call the local EXE. This EXE would be coded in VB btw. But we can't figure out how to set the program to register on SM59, using "Start on Front-End Station" option.
    Has anyone any clue on how the program should look like ?
    Thx in advance,
    N H

    Hi MxG,
    I guess we're close to the solution.
    So, using the .Net Connector, and declaring inside our program the Host and Server Class, we've managed to use it, as a registered Server Program. Actually our Registered Program is a Windows Service running on the local computer that the RFC Function Module refers to.
    While testing this it's appeared that user B was trying to use device on User A, event thought devices and services were installed on both computers.
    I guess there's something we're misunderstanding or missing when we try to convert our solution to a Front-End solution. The program is obviously incomplete, something is missing. But I can't find any example or start-up for that program. Even in SAPHelp, there's only something saying that "you can do your own program for front-end and RFC"...   :/
    Well, I've just realized I've reformulated my issue, but since it's confusing for me, it's actually not easy to describe and make sure it's understandable !
    Regards,
    N H

Maybe you are looking for