The file is saved in /tmp but only every other time ...
The RPGLE program that calls this screen has a simple EXFMT and ends with * INLR = * on
One time it works, then a second time no, no file is generated in the IFS, any idea why?
You run pui.uploadSignature() -- which causes an upload to run in the background. How long that upload takes will depend on the size of the signature, the speed of the network, how fast the server is able to respond, and several other things, so there's no easy way to tell how long it'll take.
Meanwhile, you run pui.click(). This will submit all of the screen data back to your RPG program, causing it to do processing, etc. When its done, it will send another screen, which will destroy the current screen (including the upload running in the background) and draw a new one.
So, it seems to me that doing a pui.uploadSignature() followed immediately by pui.click() would cause a "timing problem". Sometimes it may work, sometimes it may not. It'd depend on which network request finishes first.
Thanks Scott.
But in my example at the beginning of this post, with a JSON.PARSE, how to code the call to the handler.
must admit that I have a little trouble with JS
Can you explain why you are doing the JSON.parse? since the code you are parsing is hard-coded right there on the screen, it seems to me that you are just adding extra work for yourself vs. just coding the js object. Why use json parse?
But, even so, you could just add the handler to the obj after the parse, so I don't really see the problem.
1. change from 'const' to 'var' so that it is not constant, i.e. you can make changes to it.
2. after the parse, do obj.handler = function() { pui.click() }