Configuring Siebel Open UI > Example of Customizing Siebel Open UI > Process of Customizing the Presentation Model >

Overriding Predefined Methods in Presentation Models


This task is a step in Process of Customizing the Presentation Model.

If Siebel Open UI calls the GetFormattedFieldValue method for a control that it only displays in the Siebel Open UI client, then this client cannot not find the field in the list of fields that it uses, and the client creates an error. To avoid this situation, in this topic you customize Siebel Open UI to override the predefined GetFormattedFieldValue method so that it does not create an error when it calls GetFormattedValue for your new list column. For more information, see GetFormattedFieldValue Method.

To override predefined methods in presentation models

  1. Use the flowcharts to identify the method that you must modify.

    Siebel Open UI displays values for applet controls and list columns after it gets these values from the client. It caches these values in the client after it downloads them from the Siebel Server. To identify the method that handles these values, you can examine the flowchart that describes how Siebel Open UI creates a new record in a list applet, and then updates the client. In this example, the flowchart indicates that it calls the GetFormattedFieldValue method. If the physical renderer requires the ShowControlValue method, then it calls the presentation model to run the GetFormattedFieldValue method. For more information, see Flow That Creates New Records in List Applets, Updating the User Interface.

  2. In the recyclebinpmodel.js file, configure Siebel Open UI to conditionally override and customize the method:

    RecycleBinPModel.prototype.Init = function(){
      SiebelAppFacade.RecycleBinPModel.superclass.Init.call(this);
      this.AddMethod("GetFormattedFieldValue", PreGetFormattedFieldValue, {sequence:true,scope:this});
      .
      .
      .
    function PreGetFormattedFieldValue(control, bUseWS, recIndex, returnStructure){
      if (control.GetName() === "Client_Select"){
        returnStructure["CancelOperation"] = true;
        returnStructure["ReturnValue"] = "";
      }
    }

where:

  • this.AddMethod adds the PreGetFormattedFieldValue method in the Init life cycle and specifies PreGetFormattedFieldValue as the customization.
  • sequence : true specifies to call the custom PreGetFormattedFieldValue before it calls the predefined GetFormattedFieldValue method.
  • The following code in the custom method determines whether or not the control that Siebel Open UI is currently examining is the client-only control:

    if (control.GetName() === "Client_Select")

    If it is, then Siebel Open UI sets the CancelOperation member of the returnStructure to true and the ReturnValue to null. For more information about returnStructure, see AddMethod Method.

  1. Save the recyclebinpmodel.js file.
Configuring Siebel Open UI Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.