Customizing the Sequence that Attaches and Validates Event Handlers
The example in this topic illustrates how you can modify the sequence that Siebel Open UI uses to attach and validate event handlers so that it stops any further event handler processing after a validation occurs. It does some custom validation, and then runs an event handler in a file named derivedpm2.js. If the user triggers a control focus event, then Siebel Open UI runs the custom event handler that displays a message in the Browser console log. The validator then returns a value of false, so Siebel Open UI stops any further event handler processing for the custom event handler and for the predefined event handler.
To customize the sequence that attaches and validates event handlers
Do Step 1 in the topic Attaching and Validating Event Handlers in Any Sequence
.Do Step 2 in the topic Attaching and Validating Event Handlers in Any Sequence, but specify the validator first, and then the event handler. You use the following code:
this.Addvalidator(siebConsts.get("PHYEVENT_COLUMN_FOCUS"), function(){ custom validation return true; }); this.AttachEventHandler(siebConsts.get("PHYEVENT_COLUMN_FOCUS"), function() { Siebjs.Log("Control Focus 2"); });
For more information about the methods that this code uses, see AddValidator Method and AttachEventHandler Method.
Do Step 5 in the topic Attaching and Validating Event Handlers in Any Sequence, but verify that Siebel Open UI displays the following text in the browser console log:
Control Focus 2 Control Focus 1