Input "On Change" is too fast

Input "On Change" is too fast

  
Hi,

I have an input with an "On Change" destination, but it triggers too fast. (around 1-2 sec.)

What ends up happenning is this: 
        - User wants to type 12.50
        - Types "12" and looks at the paper
        - Types ".50", but it replaces the "12"


Is there a way (argument?) to delay the trigger a couple of seconds? Another (better) way to overcome this?

Thank you.
Hi Cristovão,

Have you tried to use the onkeyup event instead?
You can even do something like:

$('#element').bind('keyup', function() { alert('hello world!!') } );
You can also do

             $('element').keyup(function() { });


Note that in jQuery, the letters 'on' are removed from all functions.

Best Regards,

Gonçalo M.

Hi Cristovao,
 
Actually, using onblur would be the best solution for that case.
Whenever the control loses focus, you save the data. See here.

:)
Yeah, wish it would be a standard option in the properties of an input-widget to be able to use OnBlur instead of OnChange.
Solution

Hi Cristovao!


You can change the trigger delay of an "On Change", by setting the osOnChangeTimerDelay javascript variable.

The default value is 800, that corresponds to a delay of 800 ms after the user stops typing.


To change this value to 3 seconds, you just have to include the following javascript statement in your eSpace javascript.


osOnChangeTimerDelay = 3000;


Thanks!

Solution
Thanks everyone. 

Ended up using "onblur" with "document.getElementById('" + bt n_name.Id + "').click();"

Took me a while to realize had to keep "Visible" as True and use style to hide it... but it's working fine now.
Hello Guys,

I've tried to do exactly the same and, at least on platform 9.1, the correct variable to use is osOnChangeTimerDelay instead of the mentioned osOnChangeTimeDelay.

Cheers,

Hi Pedro,

That's what Ricardo also mentioned, he just made a typo in the example.
Just to ensure! =)

Any idea if a similar setting kan be used in a P10 generated application ? Setting the timer variable does not work in that setup unfortunately, it also uses a very short timeout.

Ricardo Ferreira wrote:

Hi Cristovao!


You can change the trigger delay of an "On Change", by setting the osOnChangeTimerDelay javascript variable.

The default value is 800, that corresponds to a delay of 800 ms after the user stops typing.


To change this value to 3 seconds, you just have to include the following javascript statement in your eSpace javascript.


osOnChangeTimerDelay = 3000;


Thanks!


Hi Ricardo, sorry for my ignorance, where can I find & change the osOnChangeTimerDelay javascript variable, could you show me a screenshot? I cannot seem to find it anywhere, sorry I'm a newbie with a personal environment only. Thanks.

Hi Andre,

It's a JavaScript variable, so it's not directly available in Service Studio. But if you start a Web App, and use your browser's devtools, you can query the variable:

If you want to change it, you'll need to write some JavaScript yourself.

Should that variable be visible in a mobile app? If I debug a mobile app in chrome and inspect with chrome dev tools, I cant see that variable. Would be good to lengthen it a bit if poss!

Hi Danny,

No, the variable is probably not available to mobile apps. But with mobile apps you have also access to onblur, which might suite you better? 

I am literally working on doing that right now Kilian, thanks!!!