Use Java Script to delay onChange Action

Hi guys, 

I am running a mobile app used to scan barcodes. To capture the barcodes I use a simple input field with an onChange action to allow multiple scans. (I scan in a input field with a bluetooth scanner)

So everytime I scan a new barcode the app clears the input field and I can scan the next barcode. Unfortunately the action is to fast for "longer" barcodes and the onChange is triggered befor the whole barcode is captured. 

I wrote a java which might help here:

this should help out but as I am a freshman I have no Idea where to place the delay in my code to run the function.

I tried it with several options. For exaple this way:


But there is no effect at all...

Maybe someone knows an option... 

Thanks! 

Tobias 


Hi Tobias,

Take a look into this thread. The Ricardo´s answers should working to you:  "You can change the trigger delay of an "On Change", by setting the osOnChangeTimerDelay javascript variable."

https://www.outsystems.com/forums/discussion/9324/input-on-change-is-too-fast/


Best Regards

Fabio


Hi Fábio,


many thanks. Actually I just don´t know where to use the Script. 

If I use it in the action flow (like in the example above) nothing happens... (By the way: If I put in a "Hello World" allert it is shown). 

If I try to put the action in the Input fields attributes or events nothing happens neither...


Best regs 

Tobias

Hi Fábio and Tobias,

I am not 100% sure but I recall when working on a mobile project, with simular issues as described by Tobias in this thread, we also looked at osOnChangeTimerDelay but this didn't seem to be usable for mobile applications only web applications.

Regards,

Daniel