0 Replies Latest reply on Dec 5, 2010 12:55 PM by mumcs01

    Search for an instance of an arraycollection to show in TextInput

    mumcs01 Level 1

      So I have a simple class to store instances from an httpservice. This is configuraton information in a key:value pair. This is read in and placed in an arrayCollection. The array collection can be from of a length of 0-100 records depdning on whats going in, and the keys are autogenerated from the device I'm talking to. (So I may not know the exact key names).


      public class Cfgdb
             public var key:String = '';
             public var value:String = '';
             public function Cfgdb(akey:String, avalue:String)
                   this.key = akey;
                   this.value = avalue;



      IN the Flex application I have a FormItem i want to populate with the class instance .value If I've read in a certain key previously. (So if an instance of a key called 'system_domain_name' exists in the arrayCollection, I want the value). How do I do this? The below clearly doesn't work,



      <mx:FormItem label="System Domain Name:">
      <mx:TextInput id="system_domain_name"
      text="{ configResults.getItemAt(configResults.getItemIndex( {key: 'system_domain_name'} )).value }"
      change="xmlEditValue('uc', '', 'system_domain_name', system_domain_name.text);"