My Books

  • Follow me on Twitter
My Photo

Subscribe my blog

  • Get this widget from Widgetbox
  • Add to Google
  • RSS FEEDS
  • Enter your Email here to subscribe :



    Powered by FeedBlitz

Blog Widget by LinkWithin

« Flex 2 and EJB3 integration, passing data from Flex 2 to JSP pages and Apollo: new contents on FlexGala User Group | Main | How to install and develop using Flex 2 (FDS) and EJB3 projects - Part 1 »

Comments

Matt

Also I think resultFormat="array" will do the trick for you to force it into an array all the time.

ajit parthan

I have seen this problem when using WebService and resultFormat="object". And the workaround used is as mentioned in the post- check for ArrayCollection etc.

I have also found cases where the result is an Array even if there is only one object- but the XSD in both cases look exactly the same.

But given that the WebService is backed by a WSDL and XSD schema that defines the result format this feels more like a hack/workaround.

Robert Stark

I haven't had time to test this code with xml, but wouldn't this do it as well.

private function resultHandler(event :ResultEvent ) :void

{

var myAC:ArrayCollection;
if( event.result.dataroot.city  == null )
{
mx.controls.Alert.show("The response data are empty !");
}
else
{
myAC = new ArrayCollection(event.result.dataroot.city as Array);
}

}

Marco Casario

Thanks Matt ;) !

Martin

hey, this is a great post i have the same problem witch 1 item result, and i resolve with you code.

Grettins from Argentina.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment