0 Replies Latest reply on Sep 21, 2009 3:08 PM by anu3000

    Error #1009:

    anu3000

      Hi,

      I am using item renderers along with actions script (class factory approach), Here is my code, but i am getting

      Error #1009 , can anybody let me know what is missing here ?

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" styleName="baseColor" verticalScrollPolicy="off"
      width="100%" height="100%" label="Crew" top="10" creationComplete="init();">

       

      <mx:Script>
        <![CDATA[
        
         import mx.managers.PopUpManager;
         import mx.core.Application;
         import includes.SimpleItemClickEvent;
         import includes.SimpleHeaderClickEvent;
         import mx.controls.CheckBox;
       
         [Bindable] private var checkBoxViewItemRenderer:ClassFactory =  new ClassFactory(GenericCheckBoxItemRenderer);
         [Bindable] private var checkBoxPrintItemRenderer:ClassFactory = new ClassFactory(GenericCheckBoxPrintItemRenderer);
                 
                  // name of property on our VO we&apos;re concerned with
                  public var dataField:String;

         // Initialize the Datagrids for the Checklist Data
         private function init():void {    
                  checkBoxViewItemRenderer.properties = {dataField: "isViewChecked"};
                  checkBoxPrintItemRenderer.properties = {dataField: "isPrintChecked"};                       
                  addEventListener(SimpleItemClickEvent.CLICK, onItemClick,false,0,true);
               
          }     
            
          private function onItemClick(e:SimpleItemClickEvent):void
                  {
                      // create refs to the items we care about
                      var ir:GenericCheckBoxItemRenderer = e.target as GenericCheckBoxItemRenderer;
                      var cb:CheckBox = ir.cb as CheckBox;               
                      // update the appropriate data property based on the CheckBox&apos;s selected state
                      e.vo[e.voPropertyName] = cb.selected;
                     
                      var irp:GenericCheckBoxPrintItemRenderer = e.target as GenericCheckBoxPrintItemRenderer;
                      var cbp:CheckBox = irp.cbp as CheckBox;               
                      // update the appropriate data property based on the CheckBox&apos;s selected state
                      e.vo[e.voPropertyName] = cbp.selected;                                              
                  }
               

               ]]>
      </mx:Script>

      <mx:VBox left="10" top="10" right="10" bottom="10" verticalScrollPolicy="off">
        <mx:Label text="{Application.application.ccModel.manageChecklistItemData.statusMessage}"
          width="100%" id="errorMsg" styleName="progressLabel" x="183"/>
        <mx:Text text="Please check the boxes below to identify which items to View or Print." width="100%"/>

       
        <mx:DataGrid id="dg" sortableColumns="false" wordWrap="true" variableRowHeight="true"
         horizontalGridLines="false" verticalGridLines="false" width="100%" height="100%" verticalAlign="top"
         dataProvider="{getCrewChecklistItemDataList}">
         <mx:columns>
          <mx:DataGridColumn headerText="View" width="20" dataField="commandId" showDataTips="true" textAlign="center" itemRenderer="{checkBoxViewItemRenderer}">
           <mx:headerRenderer>
                <mx:Component>
             <mx:Image source="{outerDocument.imageZoom}" toolTip="View" horizontalAlign="center"/>
                </mx:Component>
           </mx:headerRenderer>
             
          </mx:DataGridColumn>
         
          <mx:DataGridColumn headerText="Print" width="20" showDataTips="true" dataField="commandId" textAlign="center" itemRenderer="{checkBoxPrintItemRenderer}">
           <mx:headerRenderer>
                <mx:Component>
             <mx:Image source="{outerDocument.imagePrint2}" toolTip="Print" horizontalAlign="center"/>
                </mx:Component>
           </mx:headerRenderer>       
          </mx:DataGridColumn>   
         
         
          <mx:DataGridColumn headerText="" width="0" dataField="commandKeyword" visible="false" dataTipField="commandKeyword" showDataTips="true"/>
          <mx:DataGridColumn headerText="" width="100" dataField="commandKeywordDisplay" dataTipField="commandKeywordDisplay" showDataTips="true"/>
          <mx:DataGridColumn headerText="" dataField="commandDescription" dataTipField="commandDescription" showDataTips="true"/>   
         </mx:columns>
        </mx:DataGrid>
        
       

       

          </mx:VBox>
      </mx:Canvas>