Showing posts with label Register PR in Siebel. Show all posts
Showing posts with label Register PR in Siebel. Show all posts

Monday 21 September 2015

Conditionally hide a field using PR file in siebel

Hi all,

Recently i had a requirement to hide a field conditionally based on the value of another field. This could be done using browser script but since we are using Open UI so we achieved it using
Physical Renderer file(PR). The arrpoach is preety simple.

1. Need to Identify the field depending on which to hide the other field or Hide same field.
2. Write the logic in PR file to hide the field.
3. Register the custom PR against the applet in Mainfest Administration.












The exact logic is :









Result
Field Active is hidden if the value is N, This can be modified for other requirement as well we just need to identify the correct element /field to hide, using inspect element.









PR file looks Like


if (typeof(SiebelAppFacade.LOYHideFieldPR) === "undefined")
 {
 SiebelJS.Namespace("SiebelAppFacade.LOYHideFieldPR"); define("siebel/custom/LOYHideFieldPR", ["siebel/phyrenderer"], function ()
 { SiebelAppFacade.LOYHideFieldPR = (function () { function LOYHideFieldPR( pm )
 { /* Be a good citizen. Let Superclass constructor function gets executed first */ SiebelAppFacade.LOYHideFieldPR.superclass.constructor.call( this, pm );
 /* Static List of Control Identifier which will be displayed in Carousel; */
 }
 SiebelJS.Extend( LOYHideFieldPR, SiebelAppFacade.PhysicalRenderer );
LOYHideFieldPR.prototype.ShowUI = function()  { SiebelAppFacade.LOYHideFieldPR.superclass.ShowUI.call( this );
 var pm = this.GetPM();
 var controls = this.GetPM().Get("GetControls");
 var cntrl = controls[ "ActiveFlag" ];
 var ActiveFlg = pm.ExecuteMethod( "GetFieldValue", cntrl );
 // alert(ActiveFlg); Test to check if value is retrieved or not
 if(ActiveFlg == "N")
 {
 $('[aria-labelledby = "ActiveFlag_Label"]').hide();
 $('#ActiveFlag_Label').parent().hide();
 } };
 return LOYHideFieldPR ; }());
 return "SiebelAppFacade.LOYHideFieldPR";
 });
}

Hope this was helpful..

Siebel GoTo View - Handling Realtime cases

 Hello All,  We all must have used GoTo view functionality of siebel to navigate to a particular view from current view. What if the require...