Text Copy of Code That Does a Partial Refresh for the Physical
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 );
};
function ModifyLayout(){
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" ];
if(canShow){
$( "#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();
}
else{
$( "#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" ){
ModifyLayout.call(this);
}
}
// 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)
;
ModifyLayout.call(this);
};
return PartialRefreshPR;
} ());
return "SiebelAppFacade.PartialRefreshPR";
});
}