2 Replies Latest reply on Jun 29, 2007 11:49 AM by Newsgroup_User

    Data not binding

    Level 7
      Can somebody point out what I am missing to bind the data from my form
      into my data model? There does not seem to be any data in the
      troubleEvent object when the save() function runs.

      <?xml version="1.0" encoding="utf-8"?>
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      top="10" left="10" right="10" bottom="10"
      title="ITB Trouble Log">

      import mx.controls.Alert;
      import Model.troubleLog;

      protected var troubleEntry:troubleLog = new troubleLog;

      protected function save(troubleEvent:Object):void
      Alert.show('test "' + troubleEvent.application + '"');

      <mx:FormItem label="Application">
      <mx:TextInput text="{troubleEntry.application}"/>
      <mx:Button label="Submit" click="save(troubleEntry)"/>
      <mx:Button label="Trouble Log" right="10" top="10"
        • 1. Re: Data not binding
          ntsiii Level 3
          How is "troubleEvent " getting populated to start with?
          • 2. Re: Data not binding
            Level 7
            ntsiii wrote:
            > How is "troubleEvent " getting populated to start with?
            > Tracy

            At this point it is not. It is using an AS data model and defaulting to
            empty|null values. I have figured out one way to bind the model to the
            form items using <mx.binding...> tags. I imagine there is a cleaner way
            to do this and would love to hear them.

            Back to your question. I need to learn how to initially populate the
            'troubleEvent' with a remote object call based on the selected item in a
            data grid in another custom MXML control that called this MXML control
            when selected.