Bind an event to a page
Use page event mappings to bind data elements within UI Builder so that you can add event actions to your page.
Before you begin
Role required: ui_builder_admin
About this task
You can bind an event to a page by using the following types of events:
- Page event mappings. Add, remove, or clear alert notifications on your page.
- Variant event mappings. Add, remove, or clear alert notifications on your page variant.
- Dispatched events. Create dispatched events for your page to create relayed event mappings that model events after a parent event handler. Select a target parent event handler to model the payload fields after it.
- Handled events. A handled event is an event that is exposed and available for use by other users. After you create a handled event, it is available under Page event mappings for other users to use. You can also set up payload fields that you create manually or choose a template for your handled event, such as an open or close a modal dialog.
Procedure
Navigate to All > Now Experience Framework > UI Builder.
Open an experience to work in or create an experience by selecting Create > Experience.
See Configure how users interact with your applications in UI Builder for more information.
Open or create a page.
For more information about how to create a page in UI Builder, see Create a page in UI Builder.
Highlight the page body in the content tree.
The body is the top-level line of the content tree. When you highlight the whole page, you can add page-level events.
Arrow pointing at the body option in the content tree.
In the configuration panel, select the Events tab.
Add an event handler in one of the following ways.
| To add this event handler | Do this |
|---|---|
| Page event mappings | Page ready source event: 1. Select Add event handler. 2. To add, remove, or clear alert notifications from the page, choose an event handler from Page-level event handlers. You can add, remove, or clear alert notifications on your page. 3. To add the event handler to your page, select Add. Page property changed source event: 1. Select Add a new event handler. 2. Choose an event handler from Page-level event handlers. You can add, remove, or clear alert notifications on your page. You can also choose Set loading state to show the word Loading on your page so users can see that the page is loading. You can also select Update client state parameter to change the client state name. 3. To add the event handler to your page, click Add. |
| Variant event mappings | Variant event mappings You must have a variant page to perform a variant event mapping. The Variant event mappings that are available depend on the variant page. If the variant page has a list, you add event handlers for things like Row clicked, Nav item, and so on. When the variant has a Viewport, you may have different event handlers to set up.
|
| Dispatched events |
Image omitted: dispatched-page-events.png Create an event dialog.</p>
Image omitted: dispatched-page-events-result.png Event handler added to dispatched events.</p>
|
| Handled events | - These events are saved in the \[sys\_ux\_event\] table. The page definition record contains references to the \[sys\_ux\_event\] record. - These events serve as source events for Page event mappings. - To create new dispatched events for your page, select Image omitted: add-icon.png +Add icon.. These events are not modeled after parent event handlers. Payload fields for handled events are created manually. To use an existing handler's payload fields as a template, select a template and edit the fields as necessary. |
Select Save.
To preview your page and test the data resource event that you set up, select
Preview button..
Parent Topic:Bind events to add actions