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

UIComponent as Button icon style causes "ArgumentError: undefined state 'up'".

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • Adobe Flex SDK 3.0 (Release)
    • None
    • mx: Button
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Internet Explorer 7.x
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a subclass of UIComponent to act as a button icon. The one I use does nothing but set its measuredWidth/Height to 16 X 16 and paint pixels in the updateDisplayList method.
      2. Use this class as the "icon" style in a Button

      Actual Results:
      Somewhere, some code is trying to set the "currentState" property of the icon instance to "up", (which is obviously a button state) but this causes an error because "up" is not a valid state for the icon. The error message is:

      ArgumentError: Undefined state 'up'.
      at mx.core::UIComponent/::getState()
      at mx.core::UIComponent/::findCommonBaseState()
      at mx.core::UIComponent/::commitCurrentState()
      at mx.core::UIComponent/setCurrentState()
      at mx.core::UIComponent/set currentState()
      at mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewIconForPhase()
      at mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::viewIcon()
      at mx.controls::Button/mx.controls:Button::commitProperties()
      at mx.core::UIComponent/validateProperties()
      at mx.managers::LayoutManager/::validateProperties()

      Expected Results:
      It should work without throwing this error, as it does in Flex 2.0.1. In Flex 2, the currentState setter of the icon object is not called.

      Workaround (if any):
      a) Use an embedded image as the icon.
      b) Extend mx.skins.ProgrammaticSkin instead of UIComponent (see workaround.zip for example)

      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: