Define Method
The Define method identifies the modules that Siebel Open UI uses to determine the location of the presentation model file or physical renderer file that Siebel Open UI must download to the client. It uses the following syntax:
define (module_name ,list_of_dependencies,function);
where:
module_name is a string that specifies the name of a module.
list_of_dependencies is an array that lists all the modules that module_name depends on to run correctly. If no dependencies exist, then this list is not required. For more information, see Specifying Dependencies Between Presentation Models or Physical Renderers and Other Files.
function identifies a function that must return an object that identifies a function name.
Siebel Open UI recommends that you use the following syntax when you use the define method:
if(typeof("SiebelAppFacade.module_name") === undefined){
SiebelJS.Namespace("SiebelAppFacade.module_name");
define("siebel/custom/module_name", [], function(){
SiebelAppFacade.module_name = (function(){
var consts = SiebelJS.Dependency("SiebelApp.Constants");
function module_name (){
SiebelAppFacade.module_name.superclass.constructor.apply(this,
arguments);;
};
SiebelJS.Extend(module_name, SiebelAppFacade.arguments_2);
return module_name:
})();
return SiebelAppFacade.module_name;
});
}
where:
SiebelAppFacade is the name space.
module_name identifies the file name of the presentation model or the physical renderer without the file name extension. For example:
RecycleBinPModel
-
function
defines the class constructor.
You use the Define method when you set up a presentation model or a physical renderer. For an example usage of this method when setting up:
A presentation model, see the figure under the topic Creating the Presentation Model.
A physical renderer, see the figure under the topic Setting Up the Physical Renderer.
For information about how to add manifest files and manifest expressions that reference the module_name, see Configuring Manifests.