Cindy Chastang
I have a function defined in the InlineJavaScript that executes a serviceCall control on the coach. I want to wait for that service call to complete so I can get the data returned and use it.
The code in the function looks something like this:
var serviceCall=thisuiview.ui.get(“Service_Call1”);
serviceCall.execute();
var result = serviceCall.getResult();
…continue processing and use the result
There is a very small delay in the serviceCall.execute before the results come back (less that a second in my unscientific observations). That causes the result to be null and the rest of the function to not behave as expected.
I tried adding a Do…While loop to wait for result to be not null. But, I’m not happy with the performance – it added an almost 6 second delay.
Do you have a recommended way to wait for a service call to complete?
jmac
Cindy:
This is all asynchronous. You would use the Service Call’s On Result (or On Error) event to know that the call has completed.
Hope this helps
JMAC
Dharmendra Ponala
Hi Cindy,
I am facing the same issue and wondering if you got a solution to this problem.
Tried calling the rest of the execution in the onResult event. But no luck onResult event doesn’t get triggered before my java script function completes.
Thanks
Dharmendra