3 Replies Latest reply on Oct 25, 2007 8:19 PM by ntsiii

    get the changed value from comboBox itemRenderer

      hi all,
      i had a problem with getting the changed value from comboBox itemRenderer.i have seen postings made early.Iam not sure of how to get it in my application.see my application and suggest me how can i get the changed value from comboBox.
      here rulesDG is ArrayCollection of Objects formed from XMLdata.
      after the user changes the value of comboBox.how to get it .

      <mx:DataGrid dataProvider="{rulesDG}" x="10" y="54" width="900" id="rulegrid" height="221" editable="true" variableRowHeight="true" >
      <mx:DataGridColumn headerText="Conditions" dataField="name" editable="true"/>
      <mx:DataGridColumn headerText="part6" dataField="part6" editable="true"/>
      <mx:DataGridColumn headerText="tech" dataField="tech" editable="true"/>
      <mx:DataGridColumn headerText="parm_name" dataField="parm_name" editable="true"/>
      <mx:DataGridColumn headerText="lot_mean" dataField="lot_mean" editable="true"/>
      <mx:DataGridColumn headerText="wafer_mean" dataField="wafer_mean" editable="true"/>
      <mx:DataGridColumn headerText="site_value" dataField="site_value" editable="true"/>
      <mx:DataGridColumn headerText="watch" dataField="watch" editable="false" width="120" rendererIsEditor="true">
      <mx:VBox width="100%">
      <mx:ComboBox id="cbx" selectedItem="{data.watch}" selectedIndex="{data.selectedIndex}">
      <mx:DataGridColumn headerText="rule_no" dataField="rule_no" editable="true"/>
      <mx:DataGridColumn headerText="waferFailCnt" dataField="waferFailCnt" editable="true"/>
      <mx:DataGridColumn headerText="action" dataField="action" editable="false"/>
      Thank you very much

        • 1. Re: get the changed value from comboBox itemRenderer
          ntsiii Level 3
          You must have your renderer update the dataProvider item, and then access the data through that.

          If you want the combo box to display the correct value, you must set the selectedIndex in the renderer. You will have to loop over the combo box dataProvider items to find a match to the value, then set the selectedIndex.

          • 2. Re: get the changed value from comboBox itemRenderer
            kittuokkade Level 1
            thanx ntsiii,this is how iam providing the data provider from xml data.rulesDg is the data provider.how can i change the objects in the data provider.please show the way.
            public function resultHandler(event:ResultEvent):void{
            sResult=event.result as String;
            anXML = new XML(sResult);
            rulesDG = new ArrayCollection( ) ;

            for (var i:int = 0; i < anXML.Rule.length();i++) {
            var resultObj:Object = new Object();
            resultObj.name=anXML.Rule .name ;
            .part6 ;
            resultObj.tech=anXML.Rule .tech ;
            .parm_name ;
            resultObj.lot_mean=anXML.Rule .lot_mean ;
            .wafer_mean ;
            resultObj.site_value=anXML.Rule .site_value ;
            .watch ;
            resultObj.rule_no=anXML.Rule .rule_no ;
            .waferFailCnt ;
            resultObj.action=anXML.Rule .action ;
            • 3. Re: get the changed value from comboBox itemRenderer
              ntsiii Level 3
              You need to read up on itemRenderers. See the Developers guide.