Deferred actions

Say you need to create a component and allow the user to interact with it. For example, the component SelectableText which used to render the answers of a slide. The answers can have additional help information that should be displayed in case the user needs it. So, first we need to pass a parameter to this component indicating if the actual answer has help information:

We also have to pass another parameter with the action to execute when the user clicks on the help icon that this component adds when its Help property is true. If we used a reference, it wouldn't work because the action would be executed when the component SelectableText was rendered. However, we only need to pass a wrapper of the action to be executed whenever the component internally decides. For that, we need to create a deferred action.

This component defines the property HelpEvent to pass this action:

Click on the bull's eye icon, change the type to Deferred action and enter the following information:

In this case, we are creating a deferred action that when executed, will call to the showHelp action of the deck component passing the parameter $item.getHelp that will resolve to the current answer (item) calling over it at the same time the action getHelp. So, basically what it is being done here is creating a deferred action that will display the answer actual help information.

In this example, the component SelectableText is inside the component Repeater that defines its Iterator property as item, making the item (answer) accessible to the SelectableText component via the $item declaration:

When a property is configured by reference, a clock will appear at the left of the field:

Last updated