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

Presentation Model Class for Applets


This topic describes the methods that Siebel Open UI uses with the presentation models that it uses to display applets. It includes the following information:

Siebel Open UI uses the PresentationModel class to define the presentation models that it uses to display applets. For more information about this class, see Presentation Model Class.

Summary of Methods That You Can Use with the Presentation Model for Applets

Table 26 lists the methods that you can use with the presentation model that Siebel Open UI uses for a predefined applet. You cannot configure Siebel Open UI to customize or override any of these methods except for the PostExecute method. You can configure Siebel Open UI to customize the PostExecute method.

Table 26. Summary of Methods That You Can Use with the Presentation Model for Applets
Method
Callable
Bindable

CanInvokeMethod

Yes

No

CanNavigate

Yes

No

CanUpdate

Yes

No

ExecuteMethod

Yes

No

ExecuteUIUpdate

No

Yes

FieldChange

No

Yes

FocusFirstControl

No

Yes

GetControl

Yes

No

GetControlId

Yes

No

GetFieldValue

Yes

No

GetFormattedFieldValue

Yes

No

GetPhysicalControlValue

No

Yes

InvokeMethod

Yes

No

InvokeStateChange

No

Yes

IsPrivateField

Yes

No

LeaveField

Yes

No

NewFileAttachment

No

Yes

PostExecute

No

Yes

ProcessCancelQueryPopup

No

Yes

RefreshData

No

Yes

ResetAppletState

No

Yes

SetActiveControl

Yes

Yes

SetFocusDefaultControl

Yes

No

SetFocusToCtrl

No

Yes

SetHighlightState

No

Yes

SetUpdateConditionals

Yes

No

ShowPickPopup

Yes

No

ShowPopup

No

Yes

ShowSelection

No

Yes

UpdateAppletMessage

No

Yes

UpdateConditionals

No

Yes

UpdateCurrencyCalcInfo

No

Yes

UpdateQuickPickInfo

No

Yes

UpdateStateChange

No

Yes

Properties of the Presentation Model That Siebel Open UI Uses for Applets

Table 27 lists the properties of the presentation model that Siebel Open UI uses for applets.

Table 27. Properties of the Presentation Model That Siebel Open UI Uses for Applets
Property
Description

GetActiveControl

Returns a string that identifies the active control of the applet for the presentation model.

GetAppleLabel

Returns a string that includes the applet label.

GetAppletSummary

Returns a string that includes the applet summary.

GetControls

Returns an array that lists control objects that the applet includes for the presentation model.

GetDefaultFocusOnNew

Returns a string that identifies the control name where Siebel Open UI must set the default focus when the user creates a new record in an applet.

GetDefaultFocusOnQuery

Returns a string that identifies the control name where Siebel Open UI must set the default focus when the user runs a query in the applet.

GetFullId

Returns a string that includes the Applet Full Id that the Siebel Server sends for the presentation model.

GetId

Returns a string that includes the applet ID that the Siebel Server sends for the presentation model. For an example usage of this property, see Customizing the Physical Renderer to Render List Applets.

GetMode

Returns a string that identifies the applet mode.

GetName

Returns a string that includes the name of the presentation model.

GetPrsrvControl

Returns a string that identifies the control object of a preserve control that Siebel Open UI sets in a leave field.

GetQueryModePrompt

Returns a string that identifies the prompt that the applet uses when it is in query mode.

GetRecordset

Returns an array that lists the record set that the applet currently contains.

GetSelection

Returns the number of records the user chooses in the applet.

GetTitle

Returns a string that includes the applet title of the presentation model.

GetUIEventMap

Returns an array that lists pending user interface events. Each element in this array identifies an event that you can access using the following code:

this.Get("GetUIEventMap") [ index ].ev

You can use the following code to access the arguments:

as this.Get("GetUIEventMap") [ index ].ar

IsInQueryMode

Returns a Boolean value that indicates if the applet is in query mode.

IsPure

Returns a Boolean value that indicates if the applet has Buscomp.

Adding Code to the Physical Renderer

You add code for some methods to the section of code in the physical renderer that binds the control to the presentation model. For example, if you must customize code for a currency calculator control, then you modify the code in the physical renderer that binds the currency calculator control to the presentation model. This appendix indicates the methods that must use this configuration.

CanInvokeMethod Method for Presentation Models

The CanInvokeMethod method that Siebel Open UI uses for presentation models determines whether or not Siebel Open UI can invoke a method. It returns one of the following values:

  • true. Siebel Open UI can invoke the method.
  • false. Siebel Open UI cannot invoke the method.

It uses the following syntax:

CanInvokeMethod(method_name)

where:

  • method_name is a string that contains the name of the method that CanInvokeMethod examines. You must enclose this string in double quotation marks, or use a literal value of methodName.

For example, you can add the following code in a physical renderer to determine whether or not Siebel Open UI can call the method that method_name specifies, and if it can call this method on the control that control specifies:

var controlSet = this.GetPM().Get("GetControls");
for(var control in controlSet){
  if(controlSet.hasOwnProperty(control)){
    var caninvoke = this.GetPM().ExecuteMethod("CanInvokeMethod", controlSet[
    control ].GetMethodName());
  }
}

To avoid an error on the Siebel Server, it is recommended that you configure Siebel Open UI to use CanInvokeMethod immediately before it uses InvokeMethod to make sure it can call the method.

For information about the CanInvokeMethod method that Siebel Open UI uses for application models, see CanInvokeMethod Method for Application Models.

For more examples that use CanInvokeMethod, see the following topics:

CanNavigate Method

The CanNavigate method determines whether or not the user can navigate a control. It returns one of the following values:

  • true. The user can navigate the control.
  • false. The user cannot navigate the control.

It uses the following syntax:

CanNavigate(activeControl.GetFieldName())

For example, the following code uses the CanNavigate method to set up a variable named canNavigate:

var controlSet = this.GetPM().Get("GetControls");
for(var control in controlSet){
  if(controlSet.hasOwnProperty(control)){
    var canNavigate = this.GetPM().ExecuteMethod("CanNavigate", controlSet[
    control ].GetName());
  }
}

The following example identifies the controls in a set of controls that reside in an applet proxy. You can then use the value that CanNavigate returns to determine whether or not Siebel Open UI can render a control as a link:

var controlSet = this.GetPM().Get("GetControls");
for(var control in controlSet){
  if(controlSet.hasOwnProperty(control)){
    var canNavigate = this.GetPM().ExecuteMethod("CanNavigate", controlSet[
    control ].GetName());
  }
}

CanUpdate Method

The CanUpdate method determines whether or not Siebel Open UI can update a control. It returns one of the following values:

  • true. The user can update the control.
  • false. The user cannot update the control.

It uses the following syntax:

CanUpdate(control_name)

where:

  • control_name identifies the name of the control that CanUpdate examines.

The following example identifies the controls that exist in a set of controls that reside in an applet proxy. You can then use the value that CanUpdate returns to write custom code in the physical renderer that modifies a control that Siebel Open UI can update:

var controlSet = this.GetPM().Get("GetControls");
for(var control in controlSet){
  if(controlSet.hasOwnProperty(control)){
    var canupdate = this.GetPM().ExecuteMethod("CanUpdate", controlSet[ control
    ].GetName());
  }
}

For an example that uses the CanUpdate method, see UpdateRecord Method.

ExecuteMethod Method

The ExecuteMethod method runs a method that is available in the presentation model. It returns nothing. It uses the following syntax:

ExecuteMethod("method_name", arguments);

where:

  • method_name is a string that identifies the name of the method that ExecuteMethod runs.
  • arguments lists the arguments that Siebel Open UI requires to run the method that method_name identifies.

For examples that use ExecuteMethod, see the following topics:

For information about how Siebel Open UI uses the ExecuteMethod method, see How Siebel Open UI Uses the Init Method of the Presentation Model.

ExecuteUIUpdate Method

The ExecuteUIUpdate method updates objects in the user interface. It uses the following syntax:

ExecuteUIUpdate()

For example, the following code in the applicationcontext.js file updates objects that reside in the current applet:

applet.ExecuteUIUpdate();

You can configure Siebel Open UI to call the ExecuteUIUpdate method in the following ways:

  • In the physical renderer:

    this.GetPM().AttachPMBinding("ExecuteUIUpdate", function(){
        custom_code
      });

  • In the presentation model:

    this.AddMethod("ExecuteUIUpdate", function(){
        custom_code
      }, {sequence: true, scope: this});

For information about where you add this code, see Adding Code to the Physical Renderer.

FieldChange Method for Presentation Models

The FieldChange method that Siebel Open UI uses with presentation models modifies the value of a field. It returns nothing. It uses the following syntax:

FieldChange(control, field_value)

where:

  • control identifies the name of a control.
  • field_value is a modified value of the control.

For example, you can add the following code to the physical renderer:

this.GetPM().AttachPMBinding("FieldChange", function(control, field_value){
    custom_code
  });

where:

  • custom_code is code that you write that sets the value for the control.

For more information about:

FocusFirstControl Method

The FocusFirstControl method sets the focus on the first control that the presentation model displays. It uses the following syntax:

FocusFirstControl()

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding("FocusFirstControl", function(){
    custom_code;
  });

where:

  • custom_code is code that you write that handles focus updates from the Siebel Server. For example, updating the enable or disable state of a user interface control that the UpdateUIButtons method of the physical renderer specifies. For more information about the UpdateUIButtons method, see Life Cycle Flows of User Interface Elements.

For information about where you add this code, see Adding Code to the Physical Renderer.

GetControl Method

The GetControl method returns a control instance. It uses the following syntax:

GetControl(control_name)

where:

  • control_name identifies the name of the control that GetControl gets.

You add this code to the physical renderer.

For examples that use GetControl, see the following topics:

GetControlId Method

The GetControlId method gets the control ID of a toggle applet. It uses the following syntax:

GetControlId()

For example, the following code gets the control ID of the toggle applet that Siebel Open UI currently displays in the client. This code resides in the applet.js file:

return this.GetToggleApplet().GetControlId();

You can add the following code to the physical renderer:

var ToggleEl = this.GetPM().ExecuteMethod("GetControlId");

For information about where you add this code, see Adding Code to the Physical Renderer.

GetFieldValue Method

The GetFieldValue method returns the value of a field. It uses the following syntax:

this.GetFieldValue(field_ame);

where:

  • field_name identifies the name of a field.

For example, the following code gets the current value of the Call Status field:

pBusComp.GetFieldValue("Call Status");

For another example that uses the GetFieldValue method, see Text Copy of Code That Does a Partial Refresh for the Presentation Model.

GetFormattedFieldValue Method

The GetFormattedFieldValue method gets the formatted field value of a control. It uses the following syntax:

value = this.GetPM().ExecuteMethod("GetFormattedFieldValue", control_name, flag, index);

where:

  • control_name identifies the name of the control.
  • flag is one of the following values:
    • true. Get the formatted field value from the work set.
    • false. Do not get the formatted field value from the work set.
  • index is an index of the record set.

For an example that uses the GetFormattedFieldValue method, see Overriding Predefined Methods in Presentation Models.

You add the GetFormattedFieldValue method to the physical renderer.

Siebel Open UI gets the formatted field value according to the locale object. For example, 1000 is an unformatted value, and 1,000 is a formatted value.

GetPhysicalControlValue Method

The GetPhysicalControlValue method gets the value of a physical control. It uses the following syntax:

GetPhysicalControlValue (control);

For example, the following code gets the value of the physical control that control identifies. This code resides in the pmodel.js file:

this.GetRenderer().GetPhysicalControlValue(control);

The following example binds the physical renderer to the presentation model. You add this code to the physical renderer:

this.AttachPMBinding("GetPhysicalControlValue", function(control){
  custom_code
});

where:

  • control identifies the control value that Siebel Open UI must get from the physical counterpart of this control from the presentation model.
  • custom_code is code that you write that gets the value from the physical control.

InvokeMethod Method for Presentation Models

The InvokeMethod method that Siebel Open UI uses for presentation models calls a method on the applet proxy. It is similar to the InvokeMethod method that Siebel Open UI uses for application models. For more information, see InvokeMethod Method for Application Models.

InvokeStateChange Method

The InvokeStateChange method invokes a state change. It allows you to configure Siebel Open UI to handle updates. Siebel Open UI calls it when it sends a can invoke notification update from the Siebel Server. The InvokeStateChange method uses the following syntax:

InvokeStateChange()

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding("InvokeStateChange", function(){
    custom_code;
  });

where:

  • custom_code is code that you write that handles updates from the Siebel Server. For example, updating the focus state of a user interface control that the UpdateUIButtons method of the physical renderer specifies. For more information about the UpdateUIButtons method, see Life Cycle Flows of User Interface Elements.

For information about where you add this code, see Adding Code to the Physical Renderer.

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

IsPrivateField Method

The IsPrivateField method determines whether or not a field is private. A private field is a type of field that only allows the record owner to view the record. For more information about private fields, see Siebel Object Types Reference.

The IsPrivateField method returns one of the following values:

  • true. The field that the control references is private.
  • false. The field that the control references is not private.

It uses the following syntax:

this.IsPrivateField(control.GetName())

You add the following code in the physical renderer:

var bPvtField = this.GetPM().ExecuteMethod("IsPrivateField", control.GetName());

LeaveField Method

The LeaveField method determines whether or not Siebel Open UI has removed the focus from a field in an applet. It returns one of the following values:

  • true. Siebel Open UI has removed the focus from a field. This situation typically occurs when the user navigates away from the field. To do this navigation, the user clicks another object in the applet or navigates away from the applet.
  • false. Siebel Open UI has not removed the focus from a field.

It uses the following syntax:

LeaveField(control,value,do_not_leave);

where:

  • control identifies the control that LeaveField examines.
  • value contains the value that Siebel Open UI sets in the proxy for the control.
  • do_not_leave is set to one of the following values:
    • true. Keep the focus on the control.
    • false. Do not keep the focus on the control.

For examples that use the LeaveField method, see Customizing the Presentation Model to Identify the Records to Delete and Customizing Methods in the Presentation Model to Store Field Values.

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

NewFileAttachment Method

The NewFileAttachment method returns the properties of a file attachment. It uses the following syntax:

var attdata = this.GetPM().ExecuteMethod ("NewFileAttachment");

It includes no arguments.

PostExecute Method

The PostExecute method runs in the presentation model after the InvokeMethod method finishes running. Siebel Open UI calls the InvokeMethod method, returns the call from the Siebel Server, and then runs PostExecute. The PostExecute method uses the following syntax:

PostExecute(cmd, inputPS, menuPS, lpcsa);

You add this code in the presentation model:

this.AddMethod("PostExecute", function(method_name, input_property_set, output_property_set)
  {custom_code},
  {sequence : true, scope : this});

where:

  • method_name identifies the method that the Siebel Server called from the applet proxy.
  • input_property_set contains the property set that Siebel Open UI sends to the Siebel Server from the applet proxy.
  • output_property_set contains the property set that Siebel Open UI sends from the Siebel Server to the applet proxy.
  • custom_code is code that you write that customizes a PostExecute method.

For an example that uses the PostExecute method, see Registering Methods to Make Sure Siebel Open UI Runs Them in the Correct Sequence.

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

ProcessCancelQueryPopup Method

The ProcessCancelQueryPopup method cancels a query dialog box if the user clicks Cancel in this dialog box. It uses the following syntax:

ProcessCancelQueryPopup()

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding ("ProcessCancelQueryPopup", function(){custom_code}, {scope : this});

where:

  • custom_code is code that you write that cancels the query dialog box.

For information about where you add this code, see Adding Code to the Physical Renderer.

RefreshData Method

The RefreshData method is proxy method that Siebel Open UI calls when it refreshes an applet in the client according to data that the applet proxy contains. It returns nothing. It uses the following syntax:

RefreshData(value)

where:

  • value contains one of the following values:
    • true. Refresh the applet.
    • false. Do not refresh the applet.

For example, the following code refreshes the current applet. It resides in the applet.js file:

this.RefreshData(true);

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding("RefreshData", function(value){
  custom_code});

where:

  • value contains one of the following values:
    • true. Refresh the applet.
    • false. Do not refresh the applet.
  • custom_code is code that you write that refreshes data in the client user interface.

For information about where you add this code, see Adding Code to the Physical Renderer.

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

ResetAppletState Method

The ResetAppletState method sets the applet to an active state if this applet is not active. It uses the following syntax:

oldActiveApplet.ResetAppletState();

It includes no arguments.

To use the ResetAppletState method, you bind the physical renderer to the presentation model. The following example binds the physical renderer to the presentation model. You add this code to the physical renderer:

this.GetPM().AttachPMBinding("ResetAppletState", function(){
    //Code that resets the applet
    }
  });

SetActiveControl Method

The SetActiveControl method sets the active property of a control in an applet. It returns nothing. It uses the following syntax:

this.ExecuteMethod("SetActiveControl", control_name);

where:

  • control_name identifies the name of a control.

The following code in the presentation model sets the active control to null so that the applet contains no active control:

this.ExecuteMethod("SetActiveControl", null);

For examples that use the SetActiveControl method, see the following topics:

The predefined Siebel Open UI code handles an active control for the applet, so it is recommended that you do not configure Siebel Open UI to directly call the SetActiveControl method. You can use SetActiveControl only in the context of another call that Siebel Open UI makes to an applet control.

SetHighlightState Method

The SetHighlightState method sets the highlight for the active applet. It uses the following syntax:

SetHighlightState(isActive, newActiveApplet)

For example:

this.SetHighlightState(isActive);

You can add the following code to the physical renderer:

this.AttachPMBinding("SetHighlightState", function(isActive, newActiveApplet){
    custom_code
  });

where:

  • custom_code is code that you write that sets the highlight.

For information about where you add this code, see Adding Code to the Physical Renderer.

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

SetFocusDefaultControl Method

The SetFocusDefaultControl method sets the default focus flag.

SetUpdateConditionals Method

Siebel Open UI calls the SetUpdateConditionals method when the Siebel Server sends change selection information or Can Invoke method notifications to the client. It uses the following syntax:

this.SetUpdateConditionals(condition);

where:

  • condition is true or false.

For example, the following code resides in the applet.js file:

this.SetUpdateConditionals(true);

You can add the following code in the physical renderer to the end of the UpdateConditionals method. This placement makes sure Siebel Open UI runs UpdateConditionals before it runs SetUpdateConditionals:

this.GetPM().ExecuteMethod("SetUpdateConditionals", false);

For more information, see Notifications That Siebel Open UI Supports.

ShowPickPopup Method

The ShowPickPopup method displays the currency pick applet when the user clicks a pick icon in a currency calculator control. It uses the following syntax:

ShowPickPopup();

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

return this.GetCurrencyApplet().ShowPickPopup(this);

You can use the following code:

this.GetPM().ExecuteMethod("ShowPickPopup");

ShowPopup Method

The ShowPopup method displays a dialog box for a calculator control, date control, or date-time control. It uses the following syntax:

ShowPopup()

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

this.ShowPopup(control);

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding ("ShowPopup", function(control){
    predefined_code;
  },{scope : this});

where:

  • predefined_code is code that exists in the physical renderer that you reuse to display the dialog box

ShowSelection Method

The ShowSelection method makes a record the active record. It does not return any values. It uses the following syntax:

ShowSelection()

It includes no arguments.

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

this.GetApplet(strAppletName).ShowSelection();

It uses the following code to bind the presentation model in the physical renderer:

this.GetPM().AttachPMBinding("ShowSelection", function(){custom_code});

where:

  • custom_code is code that you write. Siebel Open UI runs the ShowSelection method that the applet proxy calls, and then runs your custom code. You add this custom code to the physical renderer.

For examples that use the ShowSelection method, see Text Copy of Code That Does a Partial Refresh for the Presentation Model and Example of Adding a New Method.

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

UpdateAppletMessage Method

The UpdateAppletMessage method updates an applet message according to modifications that exist on the Siebel Server. It uses the following syntax:

UpdateAppletMessage()

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

this.UpdateAppletMessage();

You add the following code to the physical renderer:

this.GetPM().AttachPMBinding ("UpdateAppletMessage", function(){custom_code}, {scope:this});
//e.g. UpdateAppletMessageUI in phyrenderer.

where:

  • custom_code is code that you write that displays a message.

For information about where you add this code, see Adding Code to the Physical Renderer.

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

UpdateConditionals Method

The UpdateConditionals method runs when Siebel Open UI displays an applet. It uses the following syntax:

UpdateConditionals()

For example, the listapplet.js file contains the following code:

this.UpdateConditionals();

You can add the following code to the code that updates the physical properties and the HTML properties of the control:

this.GetPM().AttachPMBinding ("UpdateConditionals", function(){custom_code}, {scope : this});

where:

  • custom_code is code that you write that updates HTML controls. Siebel Open UI runs this code as soon as the proxy calls the UpdateConditionals method.

For information about where you add this code, see Adding Code to the Physical Renderer.

UpdateCurrencyCalcInfo Method

The UpdateCurrencyCalcInfo method updates information that Siebel Open UI uses for a currency calculation. Siebel Open UI calls it when it sends currency information from the Siebel Server. You can use it to display currency information in an applet. It uses the following syntax:

UpdateCurrencyCalcInfo(0,args)

For example, the applet.js file contains the following code:

this.UpdateCurrencyCalcInfo(0,args);

You can add the following code to the InvokeCurrencyApplet method of the physical renderer:

this.GetPM().AttachPMBinding ("UpdateCurrencyCalcInfo", function(){custom_code}
, {scope : this});

where:

  • custom_code is code that you write that updates information in the currency calculator control.

For information about where you add this code, see Adding Code to the Physical Renderer.

UpdateQuickPickInfo Method

The UpdateQuickPickInfo method updates List of Values (LOV) information. Siebel Open UI calls it when it sends LOV information from the Siebel Server to the client. It uses the following syntax:

UpdateQuickPickInfo(field, true, arrValues, 0);

For example:

this.UpdateQuickPickInfo(field, true, arrValues, 0);

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding ("UpdateQuickPickInfo", function(){custom_code}, {scope:this});

where:

  • custom_code is code that you write that updates information in the LOV.

For information about where you add this code, see Adding Code to the Physical Renderer.

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

UpdateStateChange Method

The UpdateStateChange method handles notification updates. Siebel Open UI calls it when it sends notification updates from the Siebel Server. It uses the following syntax:

UpdateStateChange()

You can add the following code to the physical renderer:

this.GetPM().AttachPMBinding("UpdateStateChange", function(){
    custom_code;
  });

where:

  • custom_code is code that you write that handles state change updates from the Siebel Server. For example, updating the enable or disable state of a user interface control that the UpdateUIControls method of the physical renderer specifies.

For information about where you add this code, see Adding Code to the Physical Renderer.

For more information about using this method, see Life Cycle Flows of User Interface Elements and Notifications That Siebel Open UI Supports.

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