Skip to Main Content

Dynamic Action (Custom Event)

Example 1

Source

1) Create Custom Event Dynamic Action
1) Identification
Name: Custom Event Alert

2) When
Event: Custom
Custom Event: CustomEvent1
Selection Type: JavaScript Expression
JavaScript Expression: document

Add True Action
1)Identification
Action: Alert

2) Settings
Text: Custom event fired successfully.

3) Execution Options
Fire on Initialization: False

On Click Button

2) Create Dynamic Action (To fire custom event dynamic action)
1) Identification
Name: On Click Example 1

2) When
Event: Click
Selection Type: Button
Button: P2_ALERT

Add True Action
1)Identification
Action: Execute JavaScript Code

2) Settings
Code: $.event.trigger("CustomEvent1");

3) Execution Options
Fire on Initialization: False

Example 2

Double click here!

Source

1) Create Custom Event Dynamic Action
1) Identification
Name: Custom Event Page Submit

2) When
Event: Custom
Custom Event: CustomEvent2
Selection Type: JavaScript Expression
JavaScript Expression: document

1)Add True Action
1)Identification
Action: Execute JavaScript Code

2) Settings
Code: alert('Another Custom event fired.');

3) Execution Options
Fire on Initialization: False

2)Add True Action
1)Identification
Action: Submit Page

2) Settings
Show Processing: True

3) Execution Options
Fire on Initialization: False

Source

Example 2 Region Static ID: dbclick

Function and Global Variable Declaration
$("#dbclick").dblclick(function(){
$.event.trigger("CustomEvent2");
});

Info

Website: www.apexlessons.com

Youtube Channel: APEX Lessons

Facebook: APEX Lessons Facebook