Events and Event Listeners in VBCS

Events and Event Listeners in VBCS

In this section, we will see Events and Event Listeners in VBCS.

What are Events?

Event occurs when something happens in application.

Example- Page Load, button click etc.

Event Listener listens to events and then starts one or more action chains. So, every event is associated with event listener and one or more action chains.

Types of Events:

VBCS is having 4 types of events:

Event Type

Event Name

Purpose

Lifecycle events:

These events are automatically triggered during page’s lifecycle

vbEnter

This is triggered when all flows or page variables have been initialized

vbBeforeEnter

This is triggered before navigating to a page

VbBeforeExit

This is triggered before leaving a page.

vbExit

This is triggered before leaving a flow or page

vbAfterNavigate 

This is triggered when navigation to the page is complete

Component events:

These events are associated with UI components in VBCS page like button, combo box etc.

ojAction 

Variable events:

These events are associated with variable when a value stored in variable is changes.

onValueChanged

Custom events:

These are user-defined event to start an action chain. It can be triggered by a fire Event method in action chain or by using fireCustomEvent () method in a module JavaScript function.

Let us create sample page and define Lifecycle events with vbEnter to display Welcome message.

Create new VBCS app with name as “VBCSEventsApp” as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

Click on Create.

Let us define new Event Listener to listen to page load event as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Select vbEnter event here and click on Next.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Create Page Action Chain and click on Finish.

A screenshot of a computer

AI-generated content may be incorrect.

This will create new action chain. Click on “Go to Action Chain” to add logic.

A screenshot of a computer

AI-generated content may be incorrect.

Now let us add notification components to display Welcome message.

A screenshot of a computer

AI-generated content may be incorrect.

Click on expression editor for Summary and Message.

A screenshot of a computer

AI-generated content may be incorrect.

Click on Save.

A screenshot of a computer

AI-generated content may be incorrect.

Run this application.

A screenshot of a computer

AI-generated content may be incorrect.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top