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

DropDownController relies on openButton when there is no need.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK 4.1 (Release)
    • Fix Version/s: None
    • Component/s: Spark: DropDownList
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Other (specify version)
      Language Found: English

      Description

      We have a custom dropdown component (in fact we have a few), and the skin part 'openButton' is optional.

      The DropDownController uses the 'openButton', when passed to it to get access to the systemManager. The systemManager then has listeners added to it in addCloseTriggers() and removeCloseTriggers() so that the drop down is shown and hidden when expected.

      It would seem that Adobe thought that users may not always want an 'openButton' when utilizing DropDownController and therefore added a setter for systemManager. The DropDownController then should add and remove the listeners successfully.

      The problem here is that when these listeners are added and removed the DropDownController truied to access the systemManager on the 'openButton', but it doesn't have an 'openButton' and therefore errors.

      There is no need for it to access the systemManager of the 'openButton' as this stage, It could just add the listener to the systemManager. See lines 313 and 343 of spark.components.supportClasses.DropDownController.

      Steps to reproduce:
      1. Create a class that uses the DropDownController.
      2. Instead of setting the 'openButton' property on the DropDownController, set the 'systemManager' property.
      3. Open the dropDown from inside your component using openDropDown().

      Actual Results:
      The DropDownController will error trying to access the systemManager or the 'openButton'.

      "TypeError: Error #1009: Cannot access a property or method of a null object reference."

      Expected Results:
      The drop down should open successfully with no errors.

      Workaround (if any):
      Always have an 'openButton' skin part in your skin and hide it from the user.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: