Listeners define how an event of a particular type from a particular component is processed in the event-processing cycle when it occurs.
When the component produces an event of the expected type, the listener catches the event and sends it to the event-processing cycle. The event is processed as defined by the properties of the listener.
Listeners defines the following:
Listener type: the type of event the listener handles
A listener catches only events with the same type as the listener type. You can use the Generic Listener if you want it to handle any event on the component.
Validators: validation expression
The event is handled only if the validation expressions are true
.
Data validation: validation expressions that validate against Constraints
When using data constraints, the expression should include a validate()
call that will trigger the constraint validation.
Handle expression: expression that is executed
The expression represents the action the listener performs to handle the event.
Event identifier: identifier of the received event
You can use the identifier in the Handle expression to acquire the event fields with event details, such as the component that produced the event, uploaded files, etc.; refer to Filtering Events on Listeners.
Execution context: execution context of the listener
All expressions defined in the listener properties, such as, its precondition, validation, etc. are evaluated in this context level.
Important: The execution context setting does not influence how View Models are merged: this is set by the merge type property on the View Model.
View model init: expression executed right after the merge or clear of view model components
The expression serves as a hook after the merge-clear phase.
Precondition: pre-condition for event handling
If the pre-condition evaluates to false the event is not handled.
Submit: defines if the document or to-do is submitted as part of the event handling;
If enabled, the relevant data in the components is persisted and the to-do becomes finished or the document closes.
Persist: if enabled, the relevant data in the processed components is persisted as part of the event handling; unlike on submit action, if the form is used by a to-do, the to-do does not become finished; if part of a document, the document remains open; persist is performed after the merge to the screen level before the transaction is committed.
You can define a persist action, which is performed immediately after the persist.
Save action: defines if the to-do or document is saved;
The save action saves the current state of the to-do or document for later editing, which includes saving the provided data; it is identical to clicking the Save button on a to-do or document in the LSPS Application User Interface; the save action does not persist the data; therefore make sure to define the Persist property if required. If a newer version of the saved to-do or document is available, the application displays a notification.
Note: A saved document is persisted in the system database as the SavedDocument record. If saved repeatedly, the same record is overwritten; hence only the last saved document version is available. On submit, the persisted document is removed. For more information on the record type and related functions, refer to the Standard Library documentation.
Navigation: defines the location where to navigate after the event is processed; you can navigate to a to-do or document, URL, custom application page (refer to the descriptions of data types defined in the human.navigation.datatypes resource in the Standard Library)
Navigation takes place after persisting, which allows you to use the persisted data in the navigation expression.
Important: If the form is used in documents, the form navigation is overridden with the document navigation.