title: Flex : How to display a DataGrid selectedItem's details in a Form
body: <p>Sorry for this long post. The question is however small but requires full detail. Thanks for reading and helping :)</p>
  
  <p>I used HTTPService POST method to call a php file that returns me an xml type of result like</p>
  
  <pre><code>&lt;user&gt;
   &lt;name&gt;jones&lt;/name&gt;
   &lt;age&gt;34&lt;/age&gt;
  &lt;/user&gt;
  </code></pre>
  
  <p>This result is obtained after the php files queries a database. The database contain other information too like (height, gender, education and address)</p>
  
  <p>Now i have a <strong>DataGrid</strong> (having two columns: NAME and AGE) and a <strong>Form</strong> below the DataGrid. I have displayed the above mentioned xml data in the DataGrid using the <strong>dataprovider="{userRequest.lastResult.User}"</strong> attribute. </p>
  
  <p>I now want to use the <strong>itemclick=itemClickEvent(event)</strong> so that when a user click on a row of the DataGrid other information related to the clicked row like (height, gender, education etc) may appear in the form which is placed below the DataGrid in the GUI. For now my itemClickEvent,  look like:</p>
  
  <pre><code>private function itemClickEvent(event:ListEvent):void
  {
    clickRow.text=String(event.rowIndex);
     //Don't know what should i assign to following labels...
     //height.text=
     //gender.text=
     //edu.text=
  }
  </code></pre>
  
  <p>Form's structure:
      
         
                
         
         
                
         
         
                
         
         
                
           </p>
  
  <p><em>Is there any way i may access the xml data from the <strong>itemClickEvent function</strong>?</em> given that the DataGrid structure header look like</p>
  
  <pre><code>&lt;mx:DataGrid id="dgUserRequest" dataProvider="{userRequest.lastResult.user}" x="28.7" y="36" width="525" height="149" itemClick="itemClickEvent(event);"&gt;
  </code></pre>
  
  <p>and the HTTPService header look like</p>
  
  <pre><code>&lt;mx:HTTPService id="userRequest" url="request.php" method=POST"&gt;
       &lt;mx:request xmlns=""&gt;
         &lt;getResult&gt;send&lt;/getResult&gt;
       &lt;/mx:request&gt;
  &lt;/mx:HTTPService&gt;
  </code></pre>
  
  <hr>
  
  <p>The concerned part of my php file is:</p>
  
  <pre><code>if($_POST['getResult'] == 'send')
  {
     $Result = mysql_query("SELECT * FROM userInfo" );
     $Return = "&lt;userInfo&gt;";
     while ( $row = mysql_fetch_object( $Result ) )
     {
       $Return .= "&lt;user&gt;&lt;name&gt;".$row-&gt;name."&lt;/name&gt;&lt;age&gt;".$row-&gt;age."&lt;/age&gt;&lt;height&gt;". $row-&gt;height."&lt;/height&gt;&lt;gender&gt;". $row-&gt;gender."&lt;/gender&gt;&lt;education&gt;".$row-&gt;education."&lt;/education&gt;&lt;/user&gt;";
     }
     $Return .= "&lt;/userInfo&gt;";
     mysql_free_result( $Result );
     print ($Return);
  </code></pre>
  
  <p>}</p>