Deriving Presentation Models, Physical Renderers, and Plug-in Wrappers
Deriving is a coding technique that you can use with Siebel Open UI to create a reference between two presentation models, physical renderers, or plug-in wrappers. Where Siebel Open UI derives one presentation model, physical renderer or plug-in wrapper from another presentation model, physical renderer or plug-in wrapper. This referencing can make sure that the derived object uses the same logic as the source object. It also helps to reduce the amount of coding you must perform.
The following code includes all the code required to derive one presentation model from another presentation model:
if( typeof( SiebelAppFacade.derived_PM_name) === "undefined" ){
SiebelJS.Namespace( "SiebelAppFacade.derived_PM_name" );
define( "siebel/custom/derived_PM_name", ["siebel/custom/source_PM"],function(){
. . .
SiebelJS.Extend(derived_PM_name, SiebelAppFacade.source_PM );
});
}
where:
derived_PM_name is the name of a presentation model that references another presentation model.
source_PM is the name of a presentation model that provides the code that derived_PM_name uses. The source_PM must already exist.
You must include the define
and Extend
statements.
For example, the following code derives a presentation model named derivedpm2
from another presentation model, named derivedpm1
:
if( typeof( SiebelAppFacade.derivedpm2 ) === "undefined" ){
SiebelJS.Namespace( "SiebelAppFacade.derivedpm2" );
define( "siebel/custom/derivedpm2", ["siebel/custom/derivedpm1"], function(){
. . .
SiebelJS.Extend( derivedpm2, SiebelAppFacade.derivedpm1 );
});
}