TABLE OF CONTENTS
Understanding Event Handlers
Event Handlers allow you to define actions triggered by specific events in your App.
You can add Event Handlers to the following Components:
- Images
- Meetings
- Buttons
- Links
- Tables
- Forms
- Multi-page forms
- MPF Navigation
- File uploaded
- Modal dialog
- IFrame
The type of the event depends on the Component you are adding the Event Handler for. For example, it may be a button click for the Button component or a table record selection for the Table component.
The following actions are available to you:
- Set a variable
- Reset a variable
- Select a tab
- Raise an audit event
- Select a page
- Open a link
- Select a UI component
- Select a table row
- Select a table column
- Add a table row
- Expand or collapse a table row
- Submit a form
- Reset a form
- Evaluate a data set
- Clear a data set result
- Set a form field
- Select a multi-page form section
- Validate a form
- Validate a multi-page form section
- Target accordion section
- Toggle overlay visibility
- Reset explicit overlay visibility
- App auth logout
- Focus a form field
- Slide carousel
These types of actions are very common in App development and provide you with a way to make your App interactive.
Adding an Event Handler
To add an Event Handler:
- Click the Component you want to create the Event Handler for.
- Navigate to Appearance and Configuration > Configuration and locate the Event Handlers section.
- Click New Event Handler.
- Specify the Handler name, select the Event type, and choose the Action.
- Click Add.
Setting a Variable
When you configure an Event handler to set a Variable Data Set, the assigned expression only evaluates when the event occurs. This means that if your expression references another Data Set, it does not automatically reevaluate if that Data Set updates.
To add an event handler that sets a Variable:
- Click the Component you want to create the Event Handler for.
- Navigate to Appearance and Configuration > Configuration and locate the Event Handlers section.
- Click New Event Handler.
- Add an event handler with the following parameters:
Handler name A descriptive name for the event. Event type Select the event that triggers the action (e.g., button click). Action Choose Set a variable. Variable to Set Select an existing Variable. Value to set Enter an expression. Refer to Understanding mustaches and expressions.
Now, once the event triggers, the variable is evaluated. If the variable value changes:
- Components using the Variable Data Set automatically redraw to reflect the new value. There is no need to apply manual updates.
- Data Sets referencing the variable re-evaluate.
Raising Audit events
App Studio provides you with a simple way to record App usage. You record events for important actions that Users take in your App. As necessary, you create reports on App usage, or behavioral patterns within the Apps that you write. As an App Builder, you can write audit events from the App Studio. CafeX provides an audit log that you can retrieve data from using an API.
App Studio makes it easy to record App usage by logging significant user actions. This feature allows you to track important events within your App, enabling you to generate detailed reports on user activity or behavioral patterns. As an App Builder, you can configure audit events directly within App Studio. Additionally, CafeX provides an API to access the audit log.
To raise an audit event, add an event handler and set the Action to Raise an audit event.
For details on CafeX Audit Events API, see Accessing Audit Information Programmatically.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article