Skip to Main Content

Breadcrumb

Overview

The FOS - Timing Actions dynamic action plug-in is our solution for controling the timing and frequency of the actions contained within a Dynamic Action such as debounce, delay or throttle. It also includes a Timer to automate the repetition of your dynamic actions.

Examples

Delay

Delays the execution of following actions (i.e. higher sequenced) within your dynamic action based on the number of milliseconds provided. Note: "Wait for Result" must be enabled for the delay to take effect.

When would I use a Delay? There are some situations when there are timing issues with multiple things firing at once. This action is a simple workaround to give you more control in dealing with these timing issues.

Debounce

Sometimes there are things happening on the page that cause a dynamic action to fire in quick succession. You can use this action to ensure that following actions only fire a single time.

This action will debounce the execution of the following actions (i.e. higher sequenced) within a dynamic action. This means that you can ensure that when a dynamic action fires in quick succession it will not run the proceeding actions until X many milliseconds (which you define) from the last call have elapsed. You have the option of immediately executing the first call.

Note: "Wait for Result" must be enabled for debouncing to work. Also, there are times where throttling makes better sense than debouncing, so please also consider using the throttle action. You can read more about debouncing and throttling here.

Throttle

Throttles the execution of the proceeding actions (i.e. higher sequenced) within your dynamic action. For example: if you set this delay to 5000 milliseconds on the click event of a button that refreshes a grid, if you click the button repeatedly in quick succession the maximum you could refresh the grid is once every five seconds.

Note: "Wait for Result" must be enabled for throttling to work. Also, there are times where debouncing makes better sense than throttling, so please also consider using the debounce action instead. You can read more about throttling and debouncing here.

Timer

The timer action allows you to periodically fire other dynamic actions listening to the "Timer Tick" or "Timer Complete" events. When would I use this? Maybe you want to refresh a report automatically every minute, or you want to check if some process has finihed running on the database.

Multiple Timers

If you have more than one timer defined on the page, please ensure you include a clientside "Javascript Expression" condition on your actions e.g.


(this.data && this.data.timerName === "TIMER_EXAMPLE1")

Timer Events

  • The "Timer Tick" fires upon every repetition after the timeout interval has elapsed. It fires against the "body" tag, so you will use a jQuery Selector when listening to this event.
  • The "Timer Complete" fires only once, after the last repetition. It fires against the "body" tag, so you will use a jQuery Selector when listening to this event. In case of an infinite timer i.e. "no limit on repetitions" then the event Timer Complete never fires!

Design

You can preview the plug-in setup as you would see it in page designer. You can either do this by clicking this button in the top right corner of each example, or you can see all the examples together in the region below.

Looking at the examples you'll see just how easy the plug-in is to use. Don't worry about changing any values as they aren't saved. We actually encourage you to change them, so you can see the behaviour of the attributes and their help text.

FAQ

  • Can I add more than one timer to the page?

    You can add an unlimited number of timers to the page, as long as you provide a unique identifier for them in the settings. Then please ensure you include a clientside "Javascript Expression" condition on your actions to filter for this unique name e.g.

    
    (this.data && this.data.timerName === "TIMER_EXAMPLE1")
    
  • Why do I have to select "Wait For Result" when using delay, debounce or throttle?

    You need to check/enable "Wait for Result" as we use the resume function that APEX provides when this option is checked. Otherwise the delay/debounce/throttle functionality doesn't work, the proceeding/following actions will fire immediately. So if you are having issues with the debounce action not working as expected please make sure you have checked this setting is enabled.