Below is a snapshot of one of my components. However I am always getting an 
error on the Datagrid (id="cmdTable') and the error is:

Multiple initializers for property 'dataProvider'. (note: 'dataProvider' is the 
default property of  'mx.controls.DataGrid').

Does this mean you can't keep more than one datagrid or datagrid type in a file?

Here is my source -

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvasxmlns:mx="http://www.adobe.com/2006/mxml"; xmlns:comp="components.*" 
width="100%" height="100%" backgroundAlpha="0.0" fontSize="14" 
initialize="init()">

<mx:Dissolve id="dissolveOut" duration="2000" alphaFrom="1.0" alphaTo="0.0"/>
    <mx:Dissolve id="dissolveIn" duration="2000" alphaFrom="0.0" alphaTo="1.0"/>
<mx:Modelid="model" source="xml/commands_6501.xml"/>   

<mx:Parallelid="showMe">
<mx:Sequence>
<mx:Glow id="glowImage" duration="1000" alphaFrom="1.0" alphaTo="0.3" 
blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0" color="0x22A050"/>
    <mx:Glow id="unglowImage" duration="1000" alphaFrom="0.3" alphaTo="1.0" 
blurXFrom="50.0" blurXTo="0.0" blurYFrom="50.0" blurYTo="0.0" color="0x3380DD"/>
</mx:Sequence>
</mx:Parallel>

<mx:Parallelid="hideMe">
<mx:Sequence>    
<mx:Glow id="ungImage" duration="1000" alphaFrom="0.3" alphaTo="1.0" 
blurXFrom="50.0" blurXTo="0.0" blurYFrom="50.0" blurYTo="0.0" color="0x3380DD"/>
<mx:Glow id="gImage" duration="1000" alphaFrom="1.0" alphaTo="0.3" 
blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0" color="0x22A050"/>
</mx:Sequence>
</mx:Parallel>
<mx:VBox width="100%" height="100%" horizontalAlign="center" 
verticalAlign="middle">
<mx:HBox width="100%" height="25%" horizontalAlign="center" 
verticalAlign="middle" backgroundAlpha="0.0">
<mx:VBox>
<mx:ComboBoxid="siteCB" dataProvider="['Select a site', '9999']"/>
<mx:ComboBox id="deviceCB" visible="{siteCB.selectedIndex >= 1}" 
enabled="{siteCB.selectedIndex >= 1}" dataProvider="['Select a device', 
'6501']" close="deviceSelected(event)" />
</mx:VBox>
<mx:Image id="deviceImage" visible="false" source="images/6501.png" 
width="100%" height="100%" autoLoad="true" scaleContent="true" 
hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
</mx:HBox>
<mx:HBox width="100%" height="60%" 
visible="{deviceCB.selectedIndex >= 1}" showEffect="{showMe}">
        <mx:VBox label="Commands" width="60%" height="100%">
        <mx:VBox width="100%" height="100%">
<mx:DataGrid id="cmdTable" dataProvider="{deviceCommands}" showHeaders="false" 
width="100%" height="85%" 
selectedIndex="0" backgroundAlpha="0.0" color="#FFFFFF">
<mx:DataGridColumn headerText="Command" width="80" dataField="title"/>
<mx:DataGridColumn headerText="Description" dataField="description"/>
</mx:DataGrid>       
        <mx:HBox width="100%" height="15%">
        <mx:ComboBox id="cmdSelector" width="200" dataProvider="{cmdArray}"/>
        <mx:TextInput id="cmdToEnter" borderStyle="solid" borderThickness="5" 
borderColor="#FFFFFF" color="#FFFFFF" backgroundAlpha="0.0"/>
        <mx:Button label="Submit" enabled="{cmdToEnter.length > 0}"/>
        </mx:HBox>
        </mx:VBox>
        </mx:VBox>
<mx:AdvancedDataGrid id="informationGrid" showHeaders="false" 
backgroundAlpha="0.0"
width="40%" height="100%" color="#FFFFFF" dataProvider="{settingStatusData}"/>  
      
</mx:HBox>
<mx:TextArea id="deviceDataFromOurTable" text="Blah Blah Blah" width="100%" 
height="15%" backgroundAlpha="0.0" visible="{deviceCB.selectedIndex >= 1}" 
showEffect="{showMe}"/>
</mx:VBox>
  
  <mx:Script>
    <![CDATA[
    
    import mx.collections.ArrayCollection;
       
        [Bindable] private var cmdArray:Array = new Array();
        [Bindable] private var deviceCommands:ArrayCollection;
        [Bindable] private var settingStatusData:ArrayCollection = new 
ArrayCollection();
        
        private function init(): void {
        cmdArray = ['antenna_delay', 'antenna_voltage', 'mask_angle'];
        deviceCommands = new ArrayCollection([{command: 'antenna_delay', 
description: 'Set the value of delay for the antenna cable'}]);
        }
        
   private function deviceSelected(event:Event): void {
var device:String = ComboBox(event.target).selectedLabel;
deviceImage.visible = true;       
//not setup the rest of the data
getDeviceSettings();
   }
   
   private function getDeviceSettings(): void {
   
   }
      
    ]]>
  </mx:Script>
  
</mx:Canvas>

thanks for the insights or help to solving this.


      

Reply via email to