Waiting for multiple asynchronous javascript calls (mobile app)

Waiting for multiple asynchronous javascript calls (mobile app)

  

Hi every one !


As it was explained in the follow article (https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/JavaScript/Extend_Your_Mobile_App_Using_JavaScript/Defining_Asynchronous_JavaScript_Code) we can call asynchronous javascript actions.


Now I need to call multiple pararell actions, and wait for them to complete. 


Javascript public libraries offers "Q" pattern for that like https://github.com/kriskowal/q


So I have two questions:


1) Does Outsystems offer some feature like that (Q.all) ?

2) How can I require local q script mentioned above on my javascript code inside an Outsystems action ? 


I could import the q.js but I don't know how to have access to it on a Javascript code.


Thanks in advance.


Luciano Guimaraes

Solution

1) Does Outsystems offer some feature like that (Q.all)?

Answer: I don't think so.

2) How can I require local q script mentioned above on my javascript code inside an Outsystems action?

Answer: The simplest way would be to add a new Script file in Service Studio's "Scripts" folder and paste the Q minified library in there.

Then you can add the script to the screen where you will use it.

After doing this the q variable should be available to use in your screen, just like it is used in the documentation you linked.


Solution

Hi Joao Pedro.

I really much appreciate your help!

It worked fine as you described.

Best regards.

Luciano Guimaraes