This content has been marked as final. Show 2 replies
I don't know the specifics of WebServices, but I can tell you how I would do it with DataServices, and WebServices contains the result event, so I have to think something similar to this will work.
The basic idea is to add an event listener to your service, so when it's done doing its thing, you can grab the information you need and store it in a local variable. Then you simply modify your slideOpen function to point at that local variable, rather than a constant value. Now knowing how your WebService returns data, I can't be too helpful with that portion, for which I apologize.
It's extremely important to remember to remove the EventListener in the handler function, so that you don't end up overloading your stack when your Web Service is called multiple times.
Anyways, that's how I would handle it with a DataService; I hope the general idea is useful, even if the specific details vary a little. Code is attached.
Also, as an addendum, if you're placing calls to multiple WebServices, you're going to want to consider either: 1. making serperate event handling functions for each Service, so you don't remove the eventListener from the wrong Service, or 2. checking the target of the result event, so you only remove the eventListener from the Service that issued the event.