Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 420781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:54:39+00:00 2026-05-12T18:54:39+00:00

Sorry for this long post. The question is however small but requires full detail.

  • 0

Sorry for this long post. The question is however small but requires full detail. Thanks for reading and helping 🙂

I used HTTPService POST method to call a php file that returns me an xml type of result like

<user>
 <name>jones</name>
 <age>34</age>
</user>

This result is obtained after the php files queries a database. The database contain other information too like (height, gender, education and address)

Now i have a DataGrid (having two columns: NAME and AGE) and a Form below the DataGrid. I have displayed the above mentioned xml data in the DataGrid using the dataprovider=”{userRequest.lastResult.User}” attribute.

I now want to use the itemclick=itemClickEvent(event) 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:

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=
}

Form’s structure:

Is there any way i may access the xml data from the itemClickEvent function? given that the DataGrid structure header look like

<mx:DataGrid id="dgUserRequest" dataProvider="{userRequest.lastResult.user}" x="28.7" y="36" width="525" height="149" itemClick="itemClickEvent(event);">

and the HTTPService header look like

<mx:HTTPService id="userRequest" url="request.php" method=POST">
     <mx:request xmlns="">
       <getResult>send</getResult>
     </mx:request>
</mx:HTTPService>

The concerned part of my php file is:

if($_POST['getResult'] == 'send')
{
   $Result = mysql_query("SELECT * FROM userInfo" );
   $Return = "<userInfo>";
   while ( $row = mysql_fetch_object( $Result ) )
   {
     $Return .= "<user><name>".$row->name."</name><age>".$row->age."</age><height>". $row->height."</height><gender>". $row->gender."</gender><education>".$row->education."</education></user>";
   }
   $Return .= "</userInfo>";
   mysql_free_result( $Result );
   print ($Return);

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:54:39+00:00Added an answer on May 12, 2026 at 6:54 pm

    If you are using userRequest.lastResult.user.name as the dataProvider for the data grid, what are your dataFields in the name and age columns?

    There is another easy way to do this. Let’s say the xml structure is something like:

    <someRootTag>
     <user>
      <name>jones</name>
      <age>34</age>
      <height>180cm</height>
     </user>
     <user>
      <name>john</name>
      <age>4</age>
      <height>100cm</height>
     </user>
     <!--more <user/> tags-->
    </someRootTag>
    

    You can achieve this using data binding. Note that resultFormat of HTTPService has been changed to e4x from the default object

    <mx:HTTPService id="service" url="data.xml" resultFormat="e4x"/>
    <mx:DataGrid id="dg" dataProvider="{service.lastResult.user}">
        <mx:columns>
            <mx:DataGridColumn dataField="name"/>
            <mx:DataGridColumn dataField="age"/>
        </mx:columns>
    </mx:DataGrid>
    <mx:Form>
        <mx:FormItem label="Name">
            <mx:TextInput text="{dg.selectedItem.name}"/>
        </mx:FormItem>
        <mx:FormItem label="Age">
            <mx:TextInput text="{dg.selectedItem.age}"/>
        </mx:FormItem>
        <mx:FormItem label="Height">
            <mx:TextInput text="{dg.selectedItem.height}"/>
        </mx:FormItem>
    </mx:Form>
    

    The only AS code you need is to call service.send() from creationComplete of the application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for the long post, but this forum always asks for use cases :-).
Long post.. sorry I've been reading up on this and tried back and forth
Sorry this is a basic question, but all my research just barely missed answering
sorry this is such a simple question but I can't figure it out. How
Sorry if this is a really basic question but it's been really getting to
Sorry if this question is too vague, but I'd rather not muddy it's point
Hello (this is a long post sorry), I am writing a application in ASP.NET
Sorry if this post appears to be long winded. I have a parent repeater
First of all, sorry if I end up making a too long post, but
I'm sorry if this question has been asked before, but the idea is hard

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.