Bookshelf Home | Contents | Index | PDF |
Configuring Siebel Open UI > Siebel Open UI Application Programming Interface > Methods of the Siebel Open UI Application Programming Interface > Presentation Model ClassThis describes the methods that Siebel Open UI uses with the PresentationModel class. It includes the following information:
Siebel Open UI defines the PresentationModel class in the pmodel.js file. AddComponentCommunication MethodThe AddComponentCommunication method binds a communication method. It uses the following arguments:
AddMethod MethodThe AddMethod method adds a method to a presentation model. You can use ExecuteMethod to run the method that AddMethod adds from the presentation model or from the physical renderer. If AddMethod attempts to add a new method that the predefined client already contains, then the new method becomes a customization of the predefined method, and this customization runs before or after the predefined method depending on the CancelOperation part of the return value. A method that customizes another method can return to the caller without running the method that it customizes. To do this, you configure Siebel Open UI to set the CancelOperation part of the return value to true. You set this property on the ReturnStructure object that Siebel Open UI sends to each method as an argument. For an example that does this configuration, see Customizing the Presentation Model to Identify the Records to Delete. The AddMethod method returns one of the following values: AddMethod
Example of Adding a New MethodThe following code adds a new ShowSelection method: this.AddMethod After Siebel Open UI adds the ShowSelection method, you can use the following code to configure Siebel Open UI to call this method. It sends a string value of this.ExecuteMethod Example of Using the Sequence ArgumentThe following code configures Siebel Open UI to attach a method. It calls this method anytime it calls the InvokeMethod method of the proxy: this.AddMethod This code sets the sequence argument to true, which configures Siebel Open UI to call the method that it sends before it calls InvokeMethod. The method that it sends gets all the arguments that InvokeMethod receives. For more information, see InvokeMethod Method for Presentation Models. Example of Overriding the Predefined Presentation ModelThe following example overrides the predefined presentation model and runs the ProcessDrillDown method: this.AddMethod Other ExamplesThe following examples also use AddMethod: this.AddMethod AddProperty MethodThe AddProperty method adds a property to a presentation model. Siebel Open UI can access it through the Get method. It returns one of the following values: this.AddProperty
For example, the following code adds the NumOfRows property and assigns a value of 10 to this property: this.AddProperty AttachEventHandler MethodThe AttachEventHandler method attaches an event handler for a physical event. It accepts the eventName and the corresponding event handler that Siebel Open UI attaches to this physical event. It returns one of the following values: AttachEventHandler
For an example that uses AttachEventHandler, see Example of the Life Cycle of a User Interface Element. You can use the AttachEventHandler method to override some of the predefined event handling. If you do this, then you must make sure it returns a value of false. For more information, see Overriding Event Handlers. For more information about events, see Siebel CRM Events You Can Use to Customize Siebel Open UI. For more information about using this method, see Life Cycle Flows of User Interface Elements. AttachNotificationHandler MethodThe AttachNotificationHandler attaches a method that handles the notification that Siebel Open UI calls when the Siebel Server sends a notification to an applet. It does this attachment when the notification occurs. It returns one of the following values:
this.AttachNotificationHandler("notification_name", handler);
AttachPMBinding MethodThe AttachPMBinding method binds a method to an existing method. Siebel Open UI calls the method that it binds when it finishes processing this existing method. The AttachPMBinding method returns one of the following values: this.AttachPMBinding("method_name",function(){SiebelJS.Log
For an example that uses AttachPMBinding, see Customizing the Physical Renderer to Refresh the Recycle Bin. For more information about using the AttachPMBinding method, see Configuring Siebel Open UI to Bind Methods and Life Cycle Flows of User Interface Elements. AttachPostProxyExecuteBinding MethodThe AttachPostProxyExecuteBinding method binds a method that resides in a proxy or presentation model to a PostExecute method. Siebel Open UI finishes the PostExecute method, and then calls the method that AttachPostProxyExecuteBinding identifies. It uses the following syntax: this.AttachPostProxyExecuteBinding
For more information, see Refreshing Custom Events and PostExecute Method. In the following example, the user clicks the New button in an applet, Siebel Open UI runs the NewRecord method, and then the client receives the reply from the Siebel Server. In this situation, you can use the following code to run some logic in the presentation model after Siebel Open UI runs the PostExecute method as part of the element life cycle:this.AttachPostProxyExecuteBinding The following code runs this same logic in the presentation model for all methods: this.AttachPostProxyExecuteBinding For more information, see NewRecord Method. For more examples that use AttachPreProxyExecuteBinding and AttachPostProxyExecuteBinding, see Customizing the Presentation Model to Call the Siebel Server and Delete a Record and Calling Methods for Applets. Using the AttachPreProxyExecuteBinding and AttachPostProxyExecuteBinding MethodsThe AttachPreProxyExecuteBinding and AttachPostProxyExecuteBinding methods provide a generic way to do more processing than the AttachNotificationHandler method provides before or after the proxy finishes processing the reply from a method that the client or the Siebel Server calls. A method might cause Siebel Open UI to create a notification from the Siebel Server that does more post-processing than the client proxy requires. This situation can occur with a custom method that you implement on the Siebel Server. For example, with an applet, business service, or some other object type. For more information, see AttachNotificationHandler Method. Siebel Open UI sends a notification only for a typical modification that occurs in the predefined product. For example, a new or deleted record or a modified record set. Siebel Open UI might not be able to identify and process the correct notification. For example, you can configure Siebel Open UI to make one call to the WriteRecord method from the client, but the server business logic might cause this method to run more than one time. Siebel Open UI might receive notifications for any WriteRecord method that occurs for a business component that it binds to the current user interface. These notifications might contain more information than the reply notification requires. For more information, see WriteRecord Method. AttachPreProxyExecuteBinding MethodThe AttachPreProxyExecuteBinding method binds a method that resides in a proxy or presentation model to a PostExecute method. Siebel Open UI calls this method, and then runs PostExecute. The AttachPreProxyExecuteBinding uses the same syntax and arguments that the AttachPostProxyExecuteBinding method uses, except you configure Siebel Open UI to call the AttachPreProxyExecuteBinding method. For more information, see AttachPostProxyExecuteBinding Method. ExecuteMethod MethodThe ExecuteMethod method runs a method. You can use it to run a predefined or custom method that the presentation model contains. It makes sure Siebel Open UI runs all dependency chains for the method that it calls. For more information about dependency chains, see About Dependency Injection. If the method that ExecuteMethod specifies:
this.GetPM().ExecuteMethod
For examples that use InvokeMethod, see Customizing the Presentation Model to Delete Records and Customizing the Presentation Model to Handle Notifications. For more information about using this method, see Life Cycle Flows of User Interface Elements. Get MethodThe Get method returns the value of the property that Siebel Open UI adds through the AddProperty method. If Siebel Open UI sends a method in the propertyValue argument of the AddProperty method, then it calls the Get method, and then sends the return value to the method that calls the Get method. For an example that uses the Get method, see Customizing the Presentation Model to Delete Records. For more information about using this method, see Life Cycle Flows of User Interface Elements. Init MethodThe Init method allows you to use different methods to customize a presentation model, such as AddMethod, AddNotificationHandler, AttachPMBinding, and so on. It uses the following syntax: For an example that uses Init, see Step 2. You must not configure Siebel Open UI to override any method that resides in a derived presentation model except for the Init method or the Setup method. You must configure Siebel Open UI to do the following:
For more information about deriving values, see About Using This Book. OnControlEvent MethodThe OnControlEvent method calls an event. It uses the following syntax: OnControlEvent
SetProperty MethodThe SetProperty method sets the value of a presentation model property. It returns one of the following values: SetProperty
If the property that the SetProperty method references does not exist, then Siebel Open UI creates this property and sets the value for it according to the SetProperty method. You can also use the AddProperty method to add a property. For examples that use SetProperty, see the following topics:
Setup Method for Presentation ModelsThe Setup method extracts the values that a property set contains. Siebel Open UI calls this Setup method when it processes the initial reply from the Siebel Server. It uses the following syntax:
For example, the following code identifies the childPropset property set: extObject.Setup
|
Configuring Siebel Open UI | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |