title: Flex 4: Binding Label To Dataprovider (SQLite)
body: <p>Let me start off by saying this is my first Flex project, so I've been reading a lot, learning a lot, but am still struggling to make this work.</p>
  
  <p>I am trying to display records from an SQLite database within my Flex mobile application. I have the input form saving data correctly to the database, and I have a datagrid that is outputting the records (so I can confirm everything looks good). However, my problem is making the data readable.</p>
  
  <p>I want the user to be able to select an identifier from either a drop down or a list (even if it's just a 1 column datagrid), and have the labels to the right update to reflect that information.</p>
  
  <p>My thought was to have the datagrid setup as such:</p>
  
  <pre><code>    &lt;mx:DataGrid x="10" y="10" width="100" height="500" id="SiteSelector" dataProvider="{siteData}" includeIn="SiteDetails" change="SiteChoice(event)"&gt;
      &lt;mx:columns&gt;
          &lt;mx:DataGridColumn headerText="Site Name" dataField="SiteName" /&gt;
      &lt;/mx:columns&gt;
  &lt;/mx:DataGrid&gt;
  </code></pre>
  
  <p>The datagrid shows the Site Name without issue from the database.  The change function:</p>
  
  <pre><code>            private function SiteChoice(event:ListEvent):void
          {
              var statement:SQLStatement = new SQLStatement();
              statement.sqlConnection = connection;
              statement.text = "SELECT * FROM SITES WHERE SITE_ID = ?"
              statement.parameters[0] = SiteSelector.selectedItem.SITE_ID;
              statement.execute();
              siteDetails.source = statement.getResult().data;
          }
  </code></pre>
  
  <p>I also have declared:</p>
  
  <pre><code>[Bindable] private var siteDetails:ArrayCollection = new ArrayCollection();
  </code></pre>
  
  <p>My question is, how do I get a label to reflect specific column data from the table?  I believe I plug it with the siteDetails as the data provider, but how do I specify that I want, say for instance, the address or site contact to appear in a label?</p>
  
  <pre><code>&lt;s:Label text="{siteDetails}" id="ExternalIPLBL"/&gt;
  </code></pre>
  
  <p>I've been searching Google and the Adobe Developer Connection/livedocs/cookbooks pretty heavily over the last week and still have yet to come up with a working solution.</p>