-
Notifications
You must be signed in to change notification settings - Fork 10
Listening to PM changes
Oleg edited this page Jan 10, 2020
·
4 revisions
There are two approaches for getting the state of Siebel Presentation Model (PM):
-
Explicitly calling the Nexus Bridge method to get PM state. When your custom PR application does an action that could change Siebel PM (e.g. when an Immediate Post Change field is updated), it can get new state of Siebel PM. The Nexus Bridge provides the variety of the methods to get the PM state, e.g.:
- getControls
- getRecordSet/getRawRecordSet
- getSelection
- getCurrentRecord
- getCurrentRecordModel
Please note that setting the value of the control that is not posting the changes immediately to the server doesn't update the value in Siebel PM.
-
Using the pubSub pattern. Your custom PR application subscribes to the changes in the Siebel PM. There are two methods to use that approach:
-
subscribe(func)
. Returns the token that could be used as an input parameter for theunsubscribe
method. The input parameter is a function to be invoked when state of Siebel PM is changed. If the function is a named function, the token will be the function name, and for the repeated call with the function with the same name, the previous subscription will be canceled. -
unsubscribe(token)
.
-
Each instance of the Nexus Bridge has its own subscribers.
The subscribed functions do not receive any input parameters, and the subscribed function needs to call the Nexus Bridge methods to get the state of Siebel PM.