On Event Extensions for Interview Buttons
An event extension for an interview button can take action in response to that event or possibly change behavior.
AddExtension pattern
The value of the event property passed into a custom search extension must be an event handler function with the required parameters, that will be invoked whenever the event occurs.
OraclePolicyAutomation.AddExtension({
<event-extension-key>: function(event) {
<code to respond to event>
}
});
The button events currently supported are listed in the table below.
| event-extension-key | event object properties | Description |
|---|---|---|
| onSubmit | interview |
Event handler invoked when the screen is submitted in response to the next/submit button being clicked or the enter key being pressed. The event object supports
Tip: An example of an event listener for the submit/next button is shown after this table. |
| onBack | interview |
Event handler invoked when the interview back button is pressed. The event object supports
|
| onNavigated | interview |
Event handler invoked when the interview has navigated to another page. It also contains:
|
| onChange | interview, control, value |
Event handler invoked when an input control is changed by the user. The event is notification only and cannot be canceled. It also contains:
Tip: An example of an event listener for an input change is shown after this table. |
| onRestart | interview |
Event handler invoked when the interview restart button is pressed. The event object supports
|
| onExit | interview |
Event handler invoked when the interview exit button is pressed. The event object supports
|
| onAddInstance | interview, control, template |
Event handler invoked when the add button is pressed on an entity collect control. The event object supports
|
| onRemoveInstance | interview, control, rowIndex, entity, instance |
Event handler invoked when the remove button is pressed on an entity collect control. The event object supports
Tip: An example of an event listener for the remove instance button is shown after this table. |
An example of an event listener for the submit/next button is:
OraclePolicyAutomation.AddExtension({
onSubmit: function(evt) {
console.log("The submit button was pressed");
evt.preventDefault();
}
});
An example of an event listener for input change is:
OraclePolicyAutomation.AddExtension({
onChange: function(evt) {
var interview = evt.interview;
var control = evt.control;
if (control.getProperty("auto")) {
interview.submit();
}
}
});
An example of an event listener for the remove instance button is:
OraclePolicyAutomation.AddExtension({
onRemoveInstance: function(evt) {
if (evt.control.getProperty("type") == "confirmation")
if (!confirm("Are you sure you want to remove?"))
evt.preventDefault();
}
});