Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Extracting Data from Nested XML Elements into Flex


Level 2

I am a newbie and have just started using Flex. I have a
little XML that I created from PHP in the following:



<name>Test I</name>






I used HTTPService provided by Flex to extract the data, and
I seem to have no issues extracting the first two columns. However,
When I got to the instructor_name, the datagrid gives me this on
the screen produced by the HTML: [object] [Object].

This is what I have in my Flex to extract this particular

<mx:DataGridColumn headerText="Instructor Name"

Does anyone have any tips on how I can get it to display Tara
Morrison in my actual result?

Anything is appreciated.

3 Replies


Former Community Member
How do you are taking result of http serivce .. Means to say
as Array Collection or xml ... show me your code may be it will
help me to solve the problem


Level 2

I have learned that the simplest way is to use the label
function in Flex, like the following:

private function lfnGeneral(item:Object,


var sLabel:String = ""

var sHeaderText:String = column.headerText; //so we can
handle the variables

switch (sHeaderText) {

case "ID":



case "Name":




return sLabel;


Of course, the backdrop is that the name of the item has to
be the same as what appears in the rendered XML file from PHP or
any other programming language.


Level 1
Hmm.. I'm a newbie too, but looking at your XML, it seems the
<instructor_name> has no direct data, instead it has two
child nodes first_name and last_name. Seems you should calling a
function that accepts an object, passing it the
<Instructor_name> object, and in that function concatenating
the children data.

Check out the help section "Using item renderers with the
AdvancedDataGrid control", create and assign a renderer for your
<instructor_name> column, and concatenate the two name fields
inside of the renderer function.

Again, I'm a newbie myself, and I have not tried the
suggestion above, but I hope it points you toward a