• Cindy Chastang
    August 11, 2016 at 4:14 am #2423

    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
    August 11, 2016 at 4:20 am #2424

    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
    February 20, 2018 at 2:44 am #4995

    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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Start typing and press Enter to search