Configuring Siebel Open UI > Siebel Open UI Application Programming Interface > Methods of the Siebel Open UI Application Programming Interface >

Physical Renderer Class


This topic describes the methods that Siebel Open UI uses with the PhysicalRenderer class. It includes the following information:

BindData Method

The BindData method downloads metadata and data from the Siebel Server to the client proxy, and then binds this data to the user interface. The list columns that a list applet uses is an example of metadata, and the record set that this list applet uses is an example of data. The BindData method uses the following syntax:

BindData(searchData, options);

For example, the following code in the renderer.js file uses the BindData method:

this.GetSearchCtrl().BindData(searchData, options);

For another example, the following code gets the value for a control from the presentation model, and then binds this value to this control:

CustomPR.prototype.BindData = function(){
    var controlSet = pm.Get("GetControls");
      for(var controlName in controlSet){
        if(controlSet.hasOwnProperty(controlName)){
          var control = controlSet[controlName];
          // Get value for this control from presentation model and bind it to
          //  the control.
        }
      }
  };

Siebel Open UI expects the physical renderer to use the BindData method to bind data to the physical control. The BindData method also gets the initial value from the presentation model, and then attaches this value to the control.

For information about:

BindEvents Method

The BindEvents method binds an event. It returns nothing. It uses the following syntax:

BindEvents(this.GetProxy().GetControls());

For example, the following code in the renderer.js file uses the BindEvents method:

this.GetConcreteRenderer().BindEvents(this.GetProxy().GetControls());

For another example, the following code binds a resize event:

CustomPR.prototype.BindEvents = function(){
    var controlSet = controls||this.GetPM().Get("GetControls");
    for(var control in controlSet){
      if(controlSet.hasOwnProperty(control)){
        // Bind for each control as required.
      }
    }
    // Resize event
    $(window).bind("resize.CustomPR", OnResize, this);
  };
  function OnResize(){
  }

Siebel Open UI expects the physical renderer to use the ShowUI method to do all possible event binding. The event can reside on an applet control or in the applet area of the DOM. This binding also applies to any custom event, such as resizing a window. For more information, see ShowUI Method and Siebel CRM Events You Can Use to Customize Siebel Open UI.

For information about how Siebel Open UI uses BindEvents, see the following topics:

EnableControl Method

The EnableControl method enables a control. It uses the following syntax:

EnableControl(control_name)

where:

  • control_name identifies the name of the control that EnableControl enables.

EndLife Method

The EndLife method ends an event. It returns nothing. It uses the following syntax:

EndLife()

It includes the following arguments:

CustomPR.prototype.EndLife = function(){
    $(object).unbind ("event.CustomPR");
  };

where:

  • object identifies the object where the event runs.
  • event identifies the name of an event.

It is recommended that you configure Siebel Open UI to end the life of any event that it no longer requires. This configuration makes sure an event handler does not continue to exist even if no object references it. For example, assume you attached a resize event on a window, and then Siebel Open UI finished running this event. The following code ends the resize event on the window object:

CustomPR.prototype.EndLife = function(){
    $(window).unbind ("resize.CustomPR");
  };

For information about how Siebel Open UI uses EndLife, see the following topics:

FieldChange Method for Physical Renderers

The FieldChange method that Siebel Open UI uses with physical renderers modifies the value of a field. It returns nothing. It uses the following syntax. You add this code to the constructor method in the physical renderer:

this.GetPM().AttachPMBinding("FieldChange", this.SetControlValue, {scope: this}

It includes no arguments.

For example, you can add the following code to the constructor method that resides in the physical renderer:

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

This code adds the following code to the BinderMethod that resides in the physical renderer:

CustomPR.prototype.SetControlValue = function(control, value){
};

Siebel Open UI finishes running the FieldChange method, and then calls the SetControlValue method that sets the value in the physical instance of the control.

For more information, see AttachPMBinding Method.

For information about the FieldChange method that Siebel Open UI uses with presentation models, including examples that use FieldChange, see FieldChange Method for Presentation Models.

GetPM Method for Physical Renderers

The GetPM method returns a presentation model instance. It uses the following syntax:

GetPM()

It includes no arguments.

For example, the jqmlistrenderer.js file includes the following code:

var listOfColumns = this.GetPM().Get("ListOfColumns");

For information about:

SetControlValue Method

The SetControlValue method sets the value for the control that Siebel Open UI sends as an argument.

For an example that uses SetControlValue, see FieldChange Method for Physical Renderers.

For more information about using this method, see Life Cycle Flows of User Interface Elements.

ShowUI Method

The ShowUI method displays the physical control that corresponds to an applet control. It returns nothing. It uses the following syntax:

ShowUI()

It includes no arguments.

For example:

CustomPR.prototype.ShowUI = function(){
  var controlSet = this.GetPM().Get("GetControls");
  for(var control in controlSet){
    if(controlSet.hasOwnProperty(control)){
      // Display each control, as required.
    }
  }
};

A physical renderer must provide a definition for each of the following methods:

  • ShowUI
  • BindEvents
  • BindData

It can do this definition in each of these methods or in a superclass, which is a parent class of the class that the method references.

For information about:

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