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

ComboBox valueCommit event dispatches twice when it should dispatch just once

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.4 (Release)
    • None
    • Events, mx: ComboBox
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a ComboBox and set the valueCommit listener to trigger a task (an easy example is to trace a word).
      2. Add a dataprovider with a a couple objects
      3. Run your program and select an object from the ComboBox (thus triggering the valueCommit event on said ComboBox).

      Actual Results:
      The valueCommit event gets triggered twice in a row.

      Expected Results:
      The valueCommit event gets triggered once.

      Workaround (if any):
      There are several ways you can work around this issue. An easy one would to be to store a boolean variable inside your class and trigger it on and off based on whether it was the 2nd occurence of the event.

      Example:
      Here's an example of it happening with the debugger thread stack.

      1st event:

      Main Thread (Suspended)
      com.onevision.view.components.reports::ReportsWindow/filterJobs
      com.onevision.view.components.reports::ReportsWindow/__filterActionComboBox_valueCommit
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      mx.core::UIComponent/dispatchEvent
      mx.controls::ComboBase/set selectedIndex
      mx.controls::ComboBox/set selectedIndex
      mx.controls::ComboBox/dropdown_changeHandler
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      mx.core::UIComponent/dispatchEvent
      mx.controls.listClasses::ListBase/mouseUpHandler
      mx.controls::List/mouseUpHandler

      2nd event:

      Main Thread (Suspended)
      com.onevision.view.components.reports::ReportsWindow/filterJobs
      com.onevision.view.components.reports::ReportsWindow/__filterActionComboBox_valueCommit
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      mx.core::UIComponent/dispatchEvent
      mx.controls::ComboBase/textInput_valueCommitHandler
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      mx.core::UIComponent/dispatchEvent
      mx.controls::TextInput/set text
      mx.controls::ComboBox/set selectedIndex
      mx.controls::ComboBox/dropdown_changeHandler
      flash.events::EventDispatcher/dispatchEventFunction [no source]
      flash.events::EventDispatcher/dispatchEvent [no source]
      mx.core::UIComponent/dispatchEvent

      So it looks like it is getting triggered by a mouseUpEvent (or keyDownHandler depending on whether you're using the mouse or the keyboard to interact with the ComboBox) when it's not supposed to, since it is already being dispatched by the dropdown_changeHandler.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: