17
Views
4
Comments
How can my slient Action wait for a  javascript to be finished before continuing
Application Type
Reactive

I Have this flow and I want to finish the javascript1 first before going to the next action.


what happens is that it assigns the value once the screen has finally been loaded.
I've already tried adding resolve in my javascript, heres the code inside my javascript:
tried putting resolve everywhere and it seems its still not commiting.

mvp_badge
MVP
Rank: #18

Hi,

Did you validate your JavaScript is actually executed successfully, by using Chrome debugger or some console.log statements?

Your code does not show where the webAuth.checksession function is called, maybe that call does not happen?

Regards,

Daniel

Rank: #170

Hi Nikkoli,

Check this docs about asynch calls in Javascript and promisses in returns, it may help.

Specially this part:


You can set something to happen after your JS is executed.

And when you use Resolve(), your entire action will be asynch see:

Hope it helps.

Cheers and Regards,

RR :)

Hello Nikkoli,


In general, for this kind of requirement, I use screen events. I write my JS code in OnReady event and use JS output data in OnRender(to assign data in some element) event. In this way, I always got proper data. 


Sanjay