Bookshelf Home | Contents | Index | PDF |
Configuring Siebel Open UI > Customizing Styles, Applets, Fields, and Controls > Customizing Applets > Displaying and Hiding FieldsThe example in this topic describes how to configure Siebel Open UI to display a field. To view a diagram that illustrates some of the objects you modify and the relationships between these objects, see Configuring Manifests. This topic is similar to the Displaying and Hiding Fields topic, but with fewer details. It demonstrates how you can quickly modify a presentation model. To customize the fields that are visible in an applet
To get a copy of the partialrefreshpm.js file, see Article ID 1494998.1 on My Oracle Support. If you do not have access to this file on My Oracle Support, then you can open a JavaScript editor, create a new file named partialrefreshpm.js, copy the following code into this file, and then save your modifications: if(typeof(SiebelAppFacade.PartialRefreshPM) === "undefined"){ SiebelJS.Namespace("SiebelAppFacade.PartialRefreshPM"); define("siebel/custom/partialrefreshpm", [], function () {( SiebelAppFacade.PartialRefreshPM = (function(){ function PartialRefreshPM(proxy){ SiebelAppFacade.PartialRefreshPM.superclass.constructor.call(this, proxy); SiebelJS.Extend(PartialRefreshPM, SiebelAppFacade.PresentationModel); PartialRefreshPM.prototype.Init = function(){ SiebelAppFacade.PartialRefreshPM.superclass.Init.call(this); this.AddProperty("ShowJobTitleRelatedField", ""); this.AddMethod("ShowSelection", SelectionChange,{sequence : false, scope : this}); this.AddMethod("FieldChange", OnFieldChange,{sequence : false, scope: this}); var controls = this.Get("GetControls"); var control = controls[ "JobTitle" ]; var value = this.ExecuteMethod("GetFieldValue", control); this.SetProperty("ShowJobTitleRelatedField", (value ? true: false)); function OnFieldChange(control, value){ if(control.GetName() === "JobTitle"){ this.SetProperty("ShowJobTitleRelatedField", (value ? true: false)); To get a copy of the partialrefreshpr.js file, see Article ID 1494998.1 on My Oracle Support. If you do not have access to this file on My Oracle Support, then you can open a JavaScript editor, create a new file named partialrefreshpr.js, copy the following code into this file, and then save your modifications: if(typeof(SiebelAppFacade.PartialRefreshPR) === "undefined"){ SiebelJS.Namespace("SiebelAppFacade.PartialRefreshPR"); //Module with its dependencies define("siebel/custom/partialrefreshpr", ["order!3rdParty/jquery.signaturepad.min", "order!siebel/phyrenderer"], function () { SiebelAppFacade.PartialRefreshPR = (function(){ function PartialRefreshPR(pm){ SiebelAppFacade.PartialRefreshPR.superclass.constructor.call(this, pm); SiebelJS.Extend(PartialRefreshPR, SiebelAppFacade.PhysicalRenderer); PartialRefreshPR.prototype.Init = function () { SiebelAppFacade.PartialRefreshPR.superclass.Init.call(this); // To act when FieldChange method is raised at PM level and execute our custom code this.AttachPMBinding( "FieldChange", FieldChange ); var controls = this.GetPM().Get("GetControls"); var control = controls[ "JobTitle" ]; var value = this.GetPM().ExecuteMethod( "GetFieldValue", control ); var canShow = ( value ? true : false); var WorkPhoneNum = controls[ "WorkPhoneNum" ]; var FaxPhoneNum = controls[ "FaxPhoneNum" ]; $( "#WorkPhoneNum_Label" ).parent().show(); // We need to take the parent to get the whole div to hide $( "[name='" + WorkPhoneNum.GetInputName() + "']" ).parent().show(); $( "#FaxPhoneNum_Label" ).parent().show(); $( "[name='" + FaxPhoneNum.GetInputName() + "']" ).parent().show(); $( "#WorkPhoneNum_Label" ).parent().hide(); $( "[name='" + WorkPhoneNum.GetInputName() + "']" ).parent().hide(); $( "#FaxPhoneNum_Label" ).parent().hide(); $( "[name='" + FaxPhoneNum.GetInputName() + "']" ).parent().hide(); function FieldChange (control, value, index) { if( control.GetName() === "JobTitle" ){ // We are overloading the standard PR ShowSelection to apply our customization // We ensure to first call the parent ShowSelection PartialRefreshPR.prototype.ShowSelection = function(index) { SiebelAppFacade.PartialRefreshPR.superclass.ShowSelection.call(this,index); |
Configuring Siebel Open UI | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |