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

When FlexNativeMenu menuShow event is dispatched, menu item-related event object properties are null

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK 3.0 (Release)
    • mx: FlexNativeMenu
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Language Found: English

    Description

      Steps to reproduce:
      1. Create the following Flex AIR application, which uses FlexNativeMenu with an XML data provider:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="#ffffff" layout="absolute">
      <mx:menu>
      <mx:FlexNativeMenu dataProvider="

      {myMenuData}

      " labelField="@label" showRoot="false" menuShow="handleEvent(event);"/>
      </mx:menu>
      <mx:XML format="e4x" id="myMenuData">
      <root>
      <menuitem label="MenuItem A">
      <menuitem label="SubMenuItem A-1"/>
      <menuitem label="SubMenuItem A-_3">
      <menuitem label="Sub-SubMenuItem A-3-1"/>
      <menuitem label="Sub-SubMenuItem A-3-2"/>
      <menuitem label="Sub-SubMenuItem A-3-3"/>
      </menuitem>
      </menuitem>
      <menuitem label="MenuItem B">
      <menuitem label="SubMenuItem B-1"/>
      <menuitem label="SubMenuItem B-2"/>
      </menuitem>
      </root>
      </mx:XML>
      <mx:Script>
      <![CDATA[
      import mx.events.FlexNativeMenuEvent;
      private function handleEvent(event:FlexNativeMenuEvent):void

      { trace("label:", event.label); // null trace("item:", event.item); // null trace("index:", event.index); // -1 trace("nativeMenuItem", event.nativeMenuItem); // null }

      ]]
      >
      </mx:Script>
      </mx:WindowedApplication>

      2. Open the application in the debugger
      3. Click on a menu item, or (when the menu is open) roll over a menu or submenu – anything to cause a menu to expand

      Actual Results: All the properties in trace() statements (event.label, event.item, event.index, event.nativeMenuItem) are null (or -1)

      Expected Results: The properties are not null, but instead have appropriate values set (e.g. event.label has the menu item's label, event.item has the underlying item from the data provider, event.nativeMenuItem has a reference to the native menu item, etc.)

      Workaround (if any):
      None that I've found

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment