TABLE OF CONTENTS
Understanding Event Handlers
You use Event Handlers to make things happen after a specific event occur in your App.
You add Event Handlers to the following Components:
- Buttons
- Table fields
- Table row selection
- Forms
You set an event type, depends on the type of Component, so it may be a button click, or a table record selection.
The following operations are available to you:
- Select a Tab
- Raise an Audit Event
- Select a Page
- Open a link
- Set a Variable
These types of operation are very common in App development, and provide you with a way to make your App interactive.
Setting a Variable
If you configure an Event handler to set a Variable Data Set, the expression only evaluates if that event occurs. This means that if you 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 on your Component.
- Go to: Configuration > Event handlers.
- Click Add handler.
- Add an event handler with the following parameters:
Handler Name | Provide a description of the event |
Event type | Select an event type |
Action | Set a variable |
Variable to Set | Select an existing Variable |
Value to Set | Enter an expression. See: Understanding mustaches and expressions. |
Now, if an App User raises the event, the expression of the variable evaluates. If the variable value changes:
- Components that use the Variable Data Set obtain the new value of the variable are redrawn. So there is no need to apply any changes to your text component.
- Data Sets that use 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.
To raise an audit event, add an event handler, and set the Action to Raise an audit event.
See also: 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