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

Cannot create MXML subclass of DataGridColumn and apply styles

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Adobe Flex SDK 4.5 (Release)
    • None
    • MXML Compiler
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. Create a subclass with this code:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:DataGridColumn xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      headerText="MyHeader"
      textAlign="center"/>

      Actual Results:
      Compiler Error:
      1119: Access of possibly undefined property styleDeclaration through a reference with static type DataGridColumnSubclass.

      Expected Results:
      Compiles and works just fine

      Workaround (if any):
      Stub out some of these getters/setters yourself. All you really need is a styleDeclaration getter to return this DataGridColumn (and a styleDeclaration setter and a styleManager getter that do nothing since they won't really get called)

      <?xml version="1.0" encoding="utf-8"?>
      <mx:DataGridColumn xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      headerText="MyHeader"
      textAlign="center">
      <fx:Script>
      <![CDATA[
      public function get styleDeclaration():CSSStyleDeclaration

      { return this; }

      public function set styleDeclaration(value:CSSStyleDeclaration):void

      { // should never be called since getter will always return something }

      public function get styleManager():IStyleManager2

      { // don't actually care what styleManager is since it's used to set styleDeclaration // which will never get called in our case anyways :-) return null; }

      ]]
      >
      </fx:Script>
      </mx:DataGridColumn>

      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: