Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Results from HTTPService call to XMLList

Posted on 2007-11-29
4
1,859 Views
Last Modified: 2012-05-05
I am trying to take the results (xml format) from an HTTPService call and create an XMLList from it so I can create an XMLListCollection from that to use to populate a tree component.  The tree component I am using has a custom built itemRenderer to put checkboxes to the left of the tree item.  But i keep getting an error when tryiong to convert to XMLList.  here is a portion of the code that handles the result from the httpservice

public function handleLocations(event:ResultEvent):void{
				this.t.text=event.result.top.toString();
				folderList = event.result.top as XMLList;
				
				folderCollection = new XMLListCollection(folderList);
				checkTree.dataProvider = folderCollection;
			}

Open in new window

0
Comment
Question by:jduawa
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 20379554
Can you put forward what is returned from the HTTPService request?

0
 
LVL 1

Author Comment

by:jduawa
ID: 20382043
here is a portion of the XML that is generated by the http request


 <?xml version="1.0" encoding="UTF-8" ?> 
<top>
 <cl_state state="unchecked" label="Alabama" isBranch="true">
  <cl_city state="unchecked" isBranch="false" label="AUBURN" data="auburn" /> 
  <cl_city state="unchecked" isBranch="false" label="TUSCALOOSA" data="tuscaloosa" /> 
  <cl_city state="unchecked" isBranch="false" label="MONTGOMERY" data="montgomery" /> 
  <cl_city state="unchecked" isBranch="false" label="MOBILE" data="mobile" /> 
  <cl_city state="unchecked" isBranch="false" label="HUNTSVILLE" data="huntsville" /> 
  <cl_city state="unchecked" isBranch="false" label="BIRMINGHAM, AL" data="bham" /> 
  </cl_state>
 <cl_state state="unchecked" label="Alaska" isBranch="true">
  <cl_city state="unchecked" isBranch="false" label="ALASKA" data="anchorage" /> 
  </cl_state>
 <cl_state state="unchecked" label="Arizona" isBranch="true">
  <cl_city state="unchecked" isBranch="false" label="YUMA" data="yuma" /> 
  <cl_city state="unchecked" isBranch="false" label="PHOENIX" data="phoenix" /> 
  <cl_city state="unchecked" isBranch="false" label="PRESCOTT" data="prescott" /> 
  <cl_city state="unchecked" isBranch="false" label="FLAGSTAFF / SEDONA" data="flagstaff" /> 
  <cl_city state="unchecked" isBranch="false" label="TUCSON" data="tucson" /> 
  </cl_state>
...
</top>

Open in new window

0
 
LVL 1

Author Comment

by:jduawa
ID: 20382054
I am using the checktreerenederer from here, at least trying to
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=545&productId=2
0
 
LVL 19

Accepted Solution

by:
Gary Benade earned 500 total points
ID: 20439800
Event.result is an XML object, so you are casting XML to XMLList which is illegal. Assuming folderList is an XMLList object, try changing your code to this:
public function handleLocations(event:ResultEvent):void
{
this.t.text=event.result.top.toString();
folderList =  XMLList( event.result.top);				
folderCollection = new XMLListCollection(folderList);
checkTree.dataProvider = folderCollection;
}

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Flex + XLSX Reader 2 1,390
Flex dropdownlist displays [object][object] 2 1,397
Flex 4.6 -- not able to Enable text fields 2 522
Querying XML Data Type 4 556
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question