Configuring Siebel Open UI > Customizing Siebel Open UI > Doing General Customization Tasks >

Using the Base Physical Renderer Class With Nonapplet Objects


This topic describes how to use the Base Physical Renderer class with nonapplet objects that you customize. It includes the following topics:

The BasePhysicalRenderer class simplifies calls that Siebel Open UI makes to the AttachPMBinding method for nonapplet objects. You can configure Siebel Open UI to use the BasePhysicalRenderer class to identify the physical renderer, call AttachPMBinding, and specify the configuration for the scope of a nonapplet object. You can then use a custom physical renderer to call AttachPMBinding with the appropriate handler.

Siebel Open UI uses the PhysicalRenderer class to interface with and to render applets. Starting with Siebel CRM versions 8.1.1.11 and 8.2.2.4, it uses the BasePhysicalRenderer class to render nonapplet objects. It uses this class to separate the interface to the physical renderer from the physical renderer. Siebel Open UI uses the BasePhysicalRenderer class only with nonapplet objects, such as the toolbar or predefined query bar.

If your deployment includes nonapplet custom rendering, and if it uses Siebel CRM version 8.1.1.10, 8.2.2.3 or earlier, then it is strongly recommended, but not required, that you modify your configuration so that it uses the BasePhysicalRenderer class to render your custom, nonapplet objects. If your deployment uses the PhysicalRenderer class to render nonapplet objects, then this class will provide access to applet functionality and properties that it does not require to do the rendering, which could degrade performance or result in rendering problems.

Siebel Open UI defines the BasePhysicalRenderer class in the basephyrenderer.js file.

Hierarchy That the Base Physical Renderer Class Uses

Figure 27 illustrates the hierarchy that the BasePhysicalRenderer class uses for nonmobile applications. The member variable is a variable that is associated with the class. All methods can access this member variable.

Figure 27. Hierarchy That the Base Physical Renderer Class Uses

Figure 28 illustrates the hierarchy that the BasePhysicalRenderer class uses for mobile applications.

Figure 28. Hierarchy That the Base Physical Renderer Class Uses for Mobile Applications

Using Methods with the Base Physical Renderer Class

Table 6 describes how to use methods with the BasePhysicalRenderer class.

Table 6. How to Use Methods with the Base Physical Renderer Class
Method
Description

Init

Use this method to initialize the BasePhysicalRenderer class. For more information, see Init Method.

GetPM

Use this method to return the name of the physical renderer. For more information, see GetPM Method for Physical Renderers.

ShowUI

Use this method to display each control in a derived class. You can configure Siebel Open UI to override this method if you must modify the control of the user interface object. For more information, see ShowUI Method.

BindEvents

Use this method to attach an event to the physical control. You can configure Siebel Open UI to override this method if you must modify event binding. For more information, see BindEvents Method.

BindData

Use this method to bind data to a physical control object that resides in a derived class. You can configure Siebel Open UI to override this method if you must modify the data binding. For more information, see BindData Method.

AttachPMBinding

Use this method to configure Siebel Open UI to do the same work that the AttachPMBinding method does in a presentation model. You can use the following argument to call the AttachPMBinding method:

scope

You can use the following arguments with the AttachPMBinding method:

  • methodName. Identifies the method that the BasePhysicalRenderer class binds.
  • handler. Identifies the handler method for this binding.
  • handlerScope. Identifies the scope where the BasePhysicalRenderer class runs the handler. If you do not specify the handlerScope, then the BasePhysicalRenderer class uses the default scope.

For more information, see AttachPMBinding Method.

EndLife

Use this method to end the life of the physical renderer. It is recommended that you use the EndLife method to clean up the custom event handler. This clean up includes releasing events, deleting unused variables, and so on. For more information, see EndLife Method.

Declaring the AttachPMBinding Method When Using the Base Physical Renderer Class

If you configure Siebel Open UI to use the BasePhysicalRenderer class, then you must declare the AttachPMBinding method.

To declare the AttachPMBinding method when using the Base Physical Renderer class

  1. Use a JavaScript editor to open your custom physical renderer.
  2. Locate the Init method.
  3. Add the following code to the Init method that you located in Step 2:

    CustomPhysicalRenderer.prototype.Init = function(){
      // Be a good citizen. Call Superclass first
      SiebelAppFacade.CustomPhysicalRenderer.superclass.Init.call(this);
      // Call AttachPMBinding here.
    }

    For example:

    CustomPhysicalRenderer.prototype.Init = function(){
      SiebelAppFacade.CustomPhysicalRenderer.superclass.Init.call(this);
      this.AttachPMBinding("EndQueryState", EndQueryState);
    }

Sending an Arbitrary Scope

An arbitrary scope is any scope other than the scope that calls the handler. You can configure Siebel Open UI to send to AttachPMBinding any scope that is available in the physical renderer. You can use the BasePhysicalRenderer class to send an arbitrary scope that identifies the handler method that Siebel Open UI must use.

To send an arbitrary scope

  1. Use a JavaScript editor to open your custom physical renderer.
  2. Add the following code to send an arbitrary scope as an argument:

    this.AttachPMBinding ("FocusOnApplet", FocusOnApplet, arbitrary_scope);

    For example:

    this.AttachPMBinding ("FocusOnApplet", FocusOnApplet, SiebelAppFacade.S_App);

    where:

    • SiebelAppFacade.S_App is an arbitrary scope because it is not the calling scope that the this statement identifies, which Siebel Open UI assumes in BasePR, by default. In this example, the FocusOnApplet handler must exist in the SiebelAppFacade.S_App scope.

Accessing Proxy Objects

If you must write code that accesses a proxy object, then it is strongly recommended that you access this proxy object through a physical renderer. The physical renderer typically exposes the interfaces that allow access to operations on the proxy object. The example in this topic accesses a proxy object for an active control.

To access proxy objects

  1. Use a JavaScript editor to open your custom physical renderer.
  2. Add the following code:

    this.ExecuteMethod("SetActiveControl", control);

    This example code accesses a proxy object so that Siebel Open UI can modify an active control.

It is recommended that you do not write code that directly accesses a proxy object from a physical renderer. In the following example, Siebel Open UI might remove the GetProxy method from the presentation model, and any code that references GetProxy might fail. It is recommended that you do not use the following code:

this.GetProxy().SetActiveControl(control);

Modifying Nonapplet Configurations for Siebel CRM Version 8.1.1.10, 8.2.2.3, or Earlier

Siebel Open UI removed the scope argument for calls that it makes to the AttachPMBinding method with nonapplet objects, starting with Siebel CRM versions 8.1.1.11 and 8.2.2.4. You can modify your custom code to use this new configuration.

To modify nonapplet configurations for Siebel CRM versions 8.1.1.10, 8.2.2.3, or earlier

  1. Use a JavaScript editor to open your custom physical renderer.
  2. Locate the following code:

    this.GetPM().AttachPMBinding ("FocusOnApplet", FocusOnApplet, {scope:this});

    In this example, AttachPMBindings uses the scope argument to do a call in Siebel CRM version 8.1.1.10, 8.2.2.3, or earlier.

  3. Replace the code that you located in Step 2 with the following code:

    this.AttachPMBinding ("FocusOnApplet", FocusOnApplet);

    You can use this code starting with Siebel CRM versions 8.1.1.11 and 8.2.2.4.

Configuring Siebel Open UI Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.