Melliti opened a new issue #976:
URL: https://github.com/apache/royale-asjs/issues/976


   hi,
   
   I have a code which use **PopUpManager.createPopUp** and it works well on 
Flex. I must turn it into Apache Royale.
   
   On my index.mxml i have:
   ```
   <?xml version="1.0" encoding="UTF-8"?>
   <ex:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
       xmlns:mx="library://ns.apache.org/royale/mx"
       xmlns:ex="library://ns.apache.org/royale/express"
       xmlns:jw="library://ns.apache.org/royale/jewel"
       xmlns:net="library://ns.apache.org/royale/net"
       xmlns:bs="library://ns.apache.org/royale/basic"
       xmlns:w3="library://ns.apache.org/royale/html"
       xmlns:ns1="components.*">
   
       <fx:Script>
       <![CDATA[
           import mx.managers.PopUpManager;
           import components.popupChangePass;
   
           [Bindable]
           public var pop:IFlexDisplayObject;
   
           public function changePass():void {
               console.log("changePass")
               pop = PopUpManager.createPopUp(this, popupChangePass, true) as 
IFlexDisplayObject; // Call another mxml
               console.log("changePass2")
               PopUpManager.centerPopUp(pop);
               console.log("changePass3")
           }
        ]]>
        </fx:Script>
   
        <ex:initialView>
           <jw:View id="maVue" currentState="login">
               <jw:Card id="loggedInForm" includeIn="logged">
   
                   <w3:H1 text="You are logged in!! :)"/>
                   <jw:HGroup width="100%">
                       <mx:LinkButton label="Bienvenue" id="bt_bienvenue" 
click="changePass()"/> // Call the method
                   </jw:HGroup>
                       <jw:Container id="Container"/>
   
               </jw:Card>
           </jw:View >
        </ex:initialView>
   </ex:Application>
   
   ```
   **popupChangePass** is another mxml with a form that should be displayed in 
the popup.
   
   It compiles but it produces an error on the browser console:
   
   ```
   Cannot read property 'parent' of null
   ```
   
   the console.log("change pass 2") is not displayed so the **createPopUp** 
fail. The Flex version works so I guess the scope of **this** is different. And 
if i console **this**, it has no parent.
   I'm not 100% sure because if **this** is the cause because the js code is 
obfuscated.
   
   Did someone else used createPopUp before and face this problem before?
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to