user interaction

user interaction

FlairBuilder - Custom events

11mo ago
SOURCE  

Description

A short tutorial describing the use of custom events in FlairBuilder - http://flairbuilder.com --- Custom events are useful in a number of cases. For instance, when, from inside a group of components, you want to notify the containing page of a certain event. But let's see first how custom events work and then how they can be used. The 'Trigger custom event' action lets you extend the built-in set of events that can be triggered by user interaction. You'll first need to specify a name for your event, something specific to your project. Then you will need to choose an option for how this event will be handled in the project. The first option specifies that the event should be triggered by the containing group or custom component. This means that if you want to handle the custom event, you'll have to do so by attaching an action to the containing group or embedded page. You'll see an example in a few moments. Click 'Apply' and now let's test this action. We attached this action to a component that is already in a group, so we'll end editing this group. We'll select the group and we see that we can attach an action to a custom event. Let's add a simple action to our custom event. We'll choose to navigate to a different page. If we input the name of our custom event, the action will be executed only when an event coming from inside the group is the one we set as the trigger using the 'Trigger custom event' action. Another way to use custom events is by triggering them so that they can be handled in any other page in the project. To do so, just select the corresponding action in the action settings panel. After you've done this, you can attach an action to your custom event for any page.