Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-23638

Call to PopUpManager.createPopUp crashes Flex app with Flex SDK 4.x (code worked fine with Flex SDK 3.x)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK 4.1 (Release)
    • None
    • PopUp Manager
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Other (specify version)
      Language Found: English

    Description

      Steps to reproduce:

      [Using Flash Builder 4 with Flex SDK 4.1.0.15132 and Flex 3 compatibility mode]

      1. make a call to PopUpManager.createPopUp with a custom component, such as
      var urlWindow:URLWindow = URLWindow(PopUpManager.createPopUp( this, URLWindow , true));

      Code for URLWindow custom component:

      ==============================================
      <?xml version="1.0" encoding="utf-8"?>
      <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
      title="URL attached to node" x="168" y="86">

      <mx:Metadata>
      [Event(name="urlAdded", type="events.URLUpdateEvent")]
      </mx:Metadata>

      <mx:Script>
      <![CDATA[
      import mx.managers.PopUpManager;
      import mx.controls.Text;
      import events.URLUpdateEvent;

      public function set url(url:String):void{
      if (url == "")

      { urlText.text = "http://"; }

      else

      { urlText.text = url; }

      this.stage.focus = urlText;
      urlText.selectionBeginIndex = urlText.selectionEndIndex = urlText.text.length;
      }

      // Event handler for the OK button.
      private function returnURL():void {
      var url:String = urlText.text;
      if (url != null && url != "http://")

      { var event:URLUpdateEvent = new URLUpdateEvent(URLUpdateEvent.URL_ADDED, url); dispatchEvent(event); }


      PopUpManager.removePopUp(this);
      }
      ]]
      >
      </mx:Script>

      <mx:HBox>
      <mx:Label text="Enter url: "/>
      <mx:TextInput id="urlText" text="" width="100%"/>
      </mx:HBox>

      <mx:HBox>
      <mx:Button label="OK" click="returnURL();"/>
      <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);"/>
      </mx:HBox>

      </mx:TitleWindow>
      ==============================================

      Actual Results:
      Flex app crashes with a Type Error #1009. Both the URLWindow and the PopUpManager exist immediately before:

      trace(URLWindow, PopUpManager) // yields: [class URLWindow] [class PopUpManager]

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at mx.managers::PopUpManagerImpl/http://www.adobe.com/2006/flex/mx/internal::createModalWindow()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:686]
      at mx.managers::PopUpManagerImpl/addPopUp()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:401]
      at mx.managers::PopUpManagerImpl/createPopUp()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:237]
      at mx.managers::PopUpManager$/createPopUp()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\PopUpManager.as:139]
      at modules::Vicos/listActionSelected()[C:\Documents and Settings\thokol\My Documents\Adobe Flash Builder 4\VicosLexus\src\modules\Vicos.mxml:520]
      at flash.events::EventDispatcher/dispatchEventFunction()
      at flash.events::EventDispatcher/dispatchEvent()
      at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12517]
      at mx.controls.listClasses::ListBase/mouseUpHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:10263]
      at mx.controls::List/mouseUpHandler()[E:\dev\4.x\frameworks\projects\framework\src\mx\controls\List.as:2469]

      Why does the stack trace contain paths such as E:\dev\4.x\frameworks (E: on my computer is the disk drive)? This looks quite weird to me. Did someone forget to remove absolute dev paths before publishing the Flex 4.x SDK?

      The problem appears independently from the browser used.

      Expected Results:
      Custom component should be dynamically added as a popup

      Workaround (if any):
      none yet

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: