This article talks on How to Show confirmation pop up on invoking method using Siebel Open UI (Only using PM File). on List Applet.
This can be achieved in two steps.
STEP 1: Add the method
// Add your method inside INIT block.
this.AddMethod("InvokeMethod", PreInvokeMethod, {sequence: true, scope: this} )
STEP 2: Define the custom method with actions to perform on invoking it. In our case , it show confirmation popup
function PreInvokeMethod(methodName , psInputArgs , ls, returnStructure){
if(methodName=="Submit"){//PLEASE CHANGE THE METHOD NAME PER REQUIREMENT
var bConfirm = confirm("Do you want to proceed?")// PLEASE CHANGE MSG PER NEED
if(!bConfirm){
returnStructure["CancelOperation"] = true;
SiebelApp.S_App.uiStatus.Free();
}}}.
PFB the complete PM file ConfirmationPM.js
if (typeof(SiebelAppFacade.ConfirmationPM) === "undefined") {
SiebelJS.Namespace("SiebelAppFacade.ConfirmationPM");
define("siebel/custom/ConfirmationPM", ["siebel/listpmodel"],
function () {
SiebelAppFacade.ConfirmationPM = (function () {
function ConfirmationPM(proxy) {
SiebelAppFacade.ConfirmationPM.superclass.constructor.apply(this, arguments);
}
SiebelJS.Extend(ConfirmationPM, SiebelAppFacade.ListPresentationModel);
ConfirmationPM.prototype.Init = function () {
SiebelAppFacade.ConfirmationPM.superclass.Init.apply(this, arguments);
this.AddMethod("InvokeMethod", PreInvokeMethod, {sequence: true, scope: this} )
}
function PreInvokeMethod(methodName , psInputArgs , ls, returnStructure){
if(methodName=="Submit"){//PLEASE CHANGE THE METHOD NAME PER REQUIREMENT
var bConfirm = confirm("Do you want to proceed?")// PLEASE CHANGE MSG PER NEED
if(!bConfirm){
returnStructure["CancelOperation"] = true;
SiebelApp.S_App.uiStatus.Free();
}
}
}
return ConfirmationPM;
}()
);
return "SiebelAppFacade.ConfirmationPM";
})
}
0 Comments