1 Reply Latest reply on Aug 25, 2011 10:30 AM by Flex harUI

    Error #1034: Type Coercion failed: cannot convert components::mycustomitemrenderer@85fbc29 to mx.con

    Ananth Flex Level 1

      dear friends....

       

                          Error #1034: Type Coercion failed: cannot convert components::mycustomitemrenderer@85fbc29 to mx.controls.listClasses.IListItemRenderer.

      help me to add event listner to below mentioned classfactory object(obj)....

      this was the error i'm getting while using class factory;

       

      my coding

      var obj:ClassFactory=new ClassFactory(components.mycustomitemrenderer);//getting error here....

      var dg_column:DataGridColumn;

      if(qry_checklist_items.length>0)

      {

      for(var i:int=0;i<qry_checklist_items.length;i++)

      {

      dg_column=new DataGridColumn();

      dg_column.headerText=qry_checklist_items[i].wf_checklist_item_name;

       

      if(qry_checklist_items[i].wf_checklist_item_input_type!="static")

      {

      dg_column.itemRenderer=obj;

       

      }

      else

      {

       

      dg_column.itemRenderer=lbl;

      }

      if(qry_checklist_items[i].wf_checklist_item_default_sort_dir!=null)

      {

      if(qry_checklist_items[i].wf_checklist_item_default_sort_dir=="asc")

      {

      dg_column.sortDescending=false;

      dg_column.setStyle("color",0xFF0000);

      dg_column.sortable=true;

       

      }

      else

      {

      dg_column.sortDescending=true;

      dg_column.setStyle("color",0xFF0000);

      dg_column.sortable=true;

      //dg_column.setStyle(mystyle,0);

      }

      }

      col_arr.push(dg_column);

      }

      dg_column=new DataGridColumn();

      dg_column.dataField="wf_checklist_result_header_notes"

      dg_column.headerText="Notes";

      //Txt_A.properties={mouseFocusChange:"submit"};

      dg_column.itemRenderer=Txt_A;

      col_arr.push(dg_column);

      dg_column=new DataGridColumn();

       

       

       

      and i wan to add event listner to the text box which is added dynalically and further i wan to add button and click event for that dynamically....

       

      is it possible?