I was wondering if it's possible to
execute action after touch start and holding down for a certain sec.
Like what we typically see on phone where you touch and hold down for like 2 secs then a popup will appear.
Hi Christian,
You can do something like the following:
This should do the trick.
Let me know if it worked.
Cheers
It works now, I missed the touch end thing thanks!. How do I open the modal that is based on the variable though? i cant assign a variable inside settimeout
Hi Ota,
You can call actions from inside the Javascript node, look at the below image:
Just Drag&Drop them to the code.
Inside the action you just do your code.
Let me know if it worked
Cheers,
Hello i would like to do the same thing that John Wrick wanted but i don't understand Henrique's answer.
Hi Eric,
On my example, I didn't use the TouchEvents block.
Ok, let's go through your questions 1 by one
You can run javascript code on client actions by using the Javascript node. The image below is not tested code, just to exemplify how you can achieve it
The handler is the one that it's present on the first image, where you pick which action will handle the OnTouchEnd. There you should cancel the timeout, so the action OpenPopup() doesn't run
--
For "do your code" i meant your business logic. On this example we were opening a popup, so on the OpenPopup action you should set the variable that controls the popup to true so the popup appear.
Let me know if it helped.
Thank you, i used a different way to do it (with OnTouchStart and OnTouchEnd) but it works right now !
Great,
I'm glad you found a solution!
Erick, share your solution
Hi Saulo,
I’ve recently published the following component to help you achieve this easier:
https://www.outsystems.com/forge/component/3374/custom-touch-events/
For this specific use case, you would use the press handler and change the time input variable.
Let me know if you have any issues,
Justin