I'm trying to dynamically create the sample below:
I have this tag in my mxml:Code:<mx:XMLList id="employees"> <employee> <name>Christina Coenraets</name> <phone>555-219-2270</phone> <email>[email protected]</email> <active>true</active> </employee> <employee> <name>Joanne Wall</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>true</active> </employee> </mx:XMLList>
<mx:XMLList id="results">
</mx:XMLList>
For some reason, Flex will not allow you to use .appendChild() unless there is already one tag. That means I'd have to do this:
<mx:XMLList id="results">
<resultList>
</resultList>
</mx:XMLList>
to get it to work which means I'd end up with something like this:
Atm, I'm taking a delimited string sent from PHP. I'm using .split() and a for loop to create a multidimensional array that I intend on populating the XMLList with. (ie. results.row[i] = myArray[i][0]; )Code:<mx:XMLList id="employees"> <resultList>//I dont want one big wrapping tag <employee> <name>Christina Coenraets</name> <phone>555-219-2270</phone> <email>[email protected]</email> <active>true</active> </employee> <employee> <name>Joanne Wall</name> <phone>555-219-2012</phone> <email>[email protected]</email> <active>true</active> </employee> </resultList> </mx:XMLList>
Am I way off on this?




Reply With Quote