AddMethod Method
The AddMethod method adds a method to a presentation model. You can use ExecuteMethod to run the method that AddMethod adds from the presentation model or from the physical renderer. If AddMethod attempts to add a new method that the predefined client already contains, then the new method becomes a customization of the predefined method, and this customization runs before or after the predefined method depending on the CancelOperation part of the return value.
A method that customizes another method can return to the caller without running the method that it customizes. To do this, you configure Siebel Open UI to set the CancelOperation part of the return value to true. You set this property on the ReturnStructure object that Siebel Open UI sends to each method as an argument. For an example that does this configuration, see Customizing the Presentation Model to Identify the Records to Delete.
The AddMethod method returns one of the following values:
True. Added a method successfully.
False. Did not add a method successfully.
It uses the following syntax:
AddMethod("methodName",methodDef(argument, argument_n){
}, {methodConfig:value});
where:
methodName is a string that contains the name of the method that Siebel Open UI adds to the presentation model.
methodDef is an argument that allows you to call a method or a method or a method reference.
argument and argument_n are arguments that AddMethod sends to the method that methodDefidentifies.
methodConfig is an argument that you set to one of the following values:
sequence. Set to one of the following values:
true. Siebel Open UI calls methodName before it calls the method that already exists in the presentation model.
false. Siebel Open UI calls methodName after it calls the method that already exists in the presentation model. The default value is false.
override. Set to one of the following values:
true. Siebel Open UI does not call the method that already exists in the presentation model. Instead, it calls the sent method, when necessary. Note that Siebel Open UI can never override some methods that exist in a predefined presentation model even if you set override to true.
false. Siebel Open UI calls the method that already exists in the presentation model.
scope. Describes the scope that Siebel Open UI must use when it calls methodDef. The default scope is Presentation Model.