Hi, I am currently trying to create a button/switch that when a user clicks on the button/switch, it wont allow users to click it for 20 seconds before they are able to click it again. Is this possible to do it in Mendix? May I know how do I go about this? I would like this feature as this button is sending data of 0 or 1 to thingspeak ( and thingspeak only allows users to send data every 20 seconds). I am using Mendix 8.18.3. Any reply would be very much appreciated!
Couple of options here:
On click of the Microflow set and commit a datetime attribute. Then every time the microflow is triggered again you can check the time between the current date and your attribute. If it is more the 20 seconds it can continue
You can add a 20 second delay in the microflow(java action from community commons). Set the progress bar of the microflow to ‘blocking’. Then the user has to wait 20 seconds for the action to finish.
Do you mind explaining more on the 1st option please? Currently I have this microflow for my button:
Its a simple microflow that whenever the button toogles to on, it sends a data value of ‘1’ to thingspeak while it sends a data value of ‘0’ to thingspeak if its off.
My attributes for button_entity are: toogle [boolean] for the button and autonum [autonum]. Do I create a loop after the merge or do I simply put a timecheck after each “Call rest activity”? I sincerely apologize for the inconvenience caused.