4 Replies Latest reply on Jul 1, 2010 7:32 AM by jerela

    Flex 4 - Can not get ADG working

    Agent-96 Level 1

      Hello,

       

      I have just downloaded flex 4 SDK (flex_sdk_4.0.0.14159_mpl) and Flash Builder 4.

       

      I have created a test prroject and can not get it working with Advanced Data Grids.

       

      Here is my set up:  Created Project called Test, this contains one MXML file that contains an Advanced Data Grid:

       

      <fx:Script>
              <![CDATA[
                  import mx.collections.HierarchicalData;
                  [Bindable] private var _test:HierarchicalData;

              ]]>
      </fx:Script>


      <mx:AdvancedDataGrid id="test" dataProvider="{_test}">
         <mx:columns>
             <mx:AdvancedDataGridColumn headerText="COL_A" />               
             <mx:AdvancedDataGridColumn headerText="COL_B" />               
             <mx:AdvancedDataGridColumn headerText="COL_C" />               
          </mx:columns>
      </mx:AdvancedDataGrid>

       

       

      This works Okay.  I then include a libary into the project, the libary, also built with the same SDK, contains a class that contains nothing but one single method that does nothing:

       

      <mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx"
                 width="100%" height="100%">

       

          <fx:Script>
              <![CDATA[
                  import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
             
                  private function test(col:AdvancedDataGridColumn):void { }

       

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

       

      Launcing now causes the error

       

      TypeError: Error #1007: Instantiation attempted on a non-constructor.
          at mx.controls::AdvancedDataGridBaseEx/getSeparator()[E:\dev\4.0.0\frameworks\projects\datav isualization\src\mx\controls\AdvancedDataGridBaseEx.as:4618]
          at mx.controls::AdvancedDataGridBaseEx/createHeaderSeparators()[E:\dev\4.0.0\frameworks\proj ects\datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:4660]
          at mx.controls::AdvancedDataGrid/createHeaderSeparators()[E:\dev\4.0.0\frameworks\projects\d atavisualization\src\mx\controls\AdvancedDataGrid.as:2428]
          at mx.controls::AdvancedDataGridBaseEx/drawSeparators()[E:\dev\4.0.0\frameworks\projects\dat avisualization\src\mx\controls\AdvancedDataGridBaseEx.as:4574]
          at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\ datavisualization\src\mx\controls\AdvancedDataGridBaseEx.as:2119]
          at mx.controls::AdvancedDataGrid/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\datavi sualization\src\mx\controls\AdvancedDataGrid.as:2899]
          at mx.controls.listClasses::AdvancedListBase/validateDisplayList()[E:\dev\4.0.0\frameworks\p rojects\datavisualization\src\mx\controls\listClasses\AdvancedListBase.as:3468]
          at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:663]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:718]
          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]

       

      Removing the method in the libary project alivates the problem.  But I can not see why this is a problem in the first place!!??!?!?!?!?!?!?

       

      Can anyone help. this is really weird.