Conditionally Binding Methods
The example in this topic conditionally binds a method.
To conditionally bind methods
-
Add the following code:
this.AttachPMBinding("DoSomething",function(){SiebelJS.Log("After DoSomething");},{when: function(function_name){return false;}});
where:
-
function_name identifies the name of a function.
-
In this example, if Siebel Open UI calls
DoSomething, then the presentation model calls the function_name that the
when
condition specifies, and then tests the return value. If
function_name returns a value of:
-
true. Then Siebel Open UI calls the AttachPMBinding method.
-
false. Then Siebel Open UI does not call the AttachPMBinding method.
If you do not include the when
condition, then Siebel Open UI runs the DoSomething method,
and then calls the AttachPMBinding method. For more information, see AttachPMBinding Method.