Hola,

tengo un componente Datagrid en un módulo de flex, el cual consta de 3 columnas, la primera muestra el número del registro a mostrar (1,2,3,4..n) el siguiente muestra el nombre de una determinada persona y la última columna muestra un checkbox para cada registro, puesto allí por medio de un itemrenderer, que a su vez es otro módulo flex. Fuera de la grilla tengo un textArea, que a su vez es otro módulo flex, lo que no puedo realizar es si el usuario ingresa como valor al textarea el número "1", por ejemplo, en la grilla se seleccione el checkbox correspondiente al registro con id "1".

Código de Grilla:

Código Flex :

<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx"  initialize="orden()" layout="absolute" width="350" height="508" xmlns:ItemEditor="ItemEditor.*">
   
   <fx:Script>
      <![CDATA[
         import mx.collections.ArrayCollection;
         import mx.core.FlexGlobals;
         [Bindable]
         public var expenses:ArrayCollection = new ArrayCollection([
            {or:1,nom:"Juanito1"},
            {or:2,nom:"Juanito2"},
            {or:3,nom:"Juanito3"},
            {or:4,nom:"Juanito4"}
         ]);
         
         public var id_orden:Number;
         
         public function orden():void{
         
            id_orden=grilla.selectedItem.or;
         
         }

         
      ]]>
   </fx:Script>
   
   <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
   </fx:Declarations>
   <mx:DataGrid x="4" y="5" height="497" dataProvider="{expenses}" id="grilla">
      <mx:columns>
         <mx:DataGridColumn headerText="Orden" dataField="or" width="80"/>
         <mx:DataGridColumn headerText="Nombre Apoderado" dataField="nom" width="170"/>
         <mx:DataGridColumn headerText="Asistencia" dataField="asis" itemRenderer="Componentes.Check" editorDataField="newValue"/>
         
      </mx:columns>
   </mx:DataGrid>
   

</mx:Module>



Código módulo que contiene el checkbox itemrenderer

Código Flex :

<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">
   

   <fx:Script>
      <![CDATA[
         import mx.collections.ArrayCollection;
         import mx.controls.Alert;
         import mx.core.FlexGlobals;
         [Bindable]
         public var id1:Number;
         override public function set data(value:Object):void
         {
            super.data = value;
            id1 = value.or;
            newValue = value.asistencia;   
            Alert.show(""+id1);
         
            
         }
         
      
         
         
         public function cambiar_estado(valor:Number):String{
            
            
            var arre:ArrayCollection=FlexGlobals.topLevelApplication.grilla.expenses;
            var largo:int=arre.length;
            var i:int=0;
            var f:String="h";
            
            
            while(i<=largo){
            
            if(valor==1){
               
               if(!asistencia.selected){
                  
                  //asistencia.selected=true;   
                  asistencia.selected=true;            
                  f="son iguales loco";
                  
                  i=4;
               }
                  
               else{
                  
                  f="no pillo ninguno igual";
                     
                  
               }
               
               
            }
            
            i++;
            }

            return f;
         
         }
      ]]>
   </fx:Script>
   
   <fx:Declarations>
      
      <fx:Boolean id="newValue"/>
   </fx:Declarations>

   <s:CheckBox id="asistencia" width="74" height="107" y="-42" selected="false" change="{data.asistencia = this.selected}"/>
   <s:NumericStepper x="12" y="34" value="{id1}"/>

   
</mx:Module>


finalmente Código de el textarea

Código Flex :

<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
         xmlns:s="library://ns.adobe.com/flex/spark" 
         xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute" width="214" height="132" initialize="init()">
   
   <fx:Script>
      <![CDATA[
         import Componentes.Check;
         
         import mx.collections.ArrayCollection;
         import mx.controls.Alert;
         import mx.controls.Text;
         import mx.core.FlexGlobals;
         
         public var orden:ArrayCollection;
         public var lenght:Number;
         public var id3:Number;
         
         public function init():void {
            orden=FlexGlobals.topLevelApplication.grilla.expenses;
            id3=FlexGlobals.topLevelApplication.check.id1;
            
            lenght=orden.length;
            largo.value=id3;
         }
         
         public function asistencia():void{
         
            var g:String;   
            g=FlexGlobals.topLevelApplication.check.cambiar_estado(1);
         
            Alert.show(g);
         
         }//fin funcion asistencia
         
         
      ]]>
   </fx:Script>
   
   
   <fx:Declarations>
      <mx:NumberValidator id="numV" 
                     source="{faltantes}" property="text" 
                      domain="int" integerError="el valor ingresado debe ser un numero" invalidCharError="El valor debe ser un número" required="false"/>
   </fx:Declarations>

   <s:TextArea id="faltantes" x="5" y="30" width="204" height="67"/>
   <s:Label x="6" y="7" text="Faltantes: Ej.:(1-12-37)" fontWeight="bold"/>
   <s:Button x="139" y="105" label="Guardar" click="asistencia()"/>
   <s:Label x="11" y="108" id="d"/>
   <s:Label x="66" y="111" id="prueba"/>
   <s:Label x="103" y="114" id="valor"/>
   <s:NumericStepper x="143" y="6" id="largo"/>


</mx:Module>





SI ALGUIEN ME PUEDE DAR UNA MANITO, SE LO AGRADECERIA INFINITAMENTE, ESPERO APORTAR A ESTE FORO CON MIS CONOCIMIENTOS DE FLEX, SALUDOS A TODOS.