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

[Bindable] tag throws an error when put on static vars getter; but works fine when put on the definition

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Adobe Flex SDK Previous
    • Component/s: Data Binding
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Steps to reproduce:
      1. Create a Flex Library Project
      2. Create a Employee class
      3. Now add bindable static variable age

      public class Employee
      {
      [Bindable]
      public static var _age : int = 0;
      }

      4. Compilation is successful. And the generated ActionScript class, _Employee-binding-generated.as, has correct getter and setter methods.
      5. Now modify the above class to something like below.

      public class Employee
      {
      private static var _age : int = 0;

      [Bindable]
      public static function get age():int

      { return _age; }

      public static function set age(value:int):void

      { _age = value; }

      }
      6. Compiler throws an error "[Bindable] not allowed on static functions"
      7. Now define a custom event in the getters [Bindable] tag, like below

      [Bindable(event="ageChange")]
      public static function get age():int
      {
      return _age;
      }
      8. Error is gone.

      Expected Results:
      Error occurred in step 6 should not happen.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: