Some Javascripts are given below which are used in pega:
Javascripts use to open in new window:
<script>
function ExportExcel(){
var windowProps = 'toolbar=no,location=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,width=750,height=600';
var URL = new SafeURL("ClassName.ActivityName"); //Replace ClassName with name of the Applies To class and ActivityName with name of your export activity
url = URL.toURL();
window.open(url,"_self", windowProps);
}
</script>
To Call Activity from Java Script:
For calling activity from Javascript, there is already a thread ..You have to use 'SafeUrl' and httpRequestAsync function in script.
<script>
function openActivity()
{
var oSafeURL = new SafeURL("Ecorp-Report.TestActivity");
openUrlInWindow(oSafeURL, 'popup', 'width=850,height=350,left=100,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no');
}
</script>
(or)
<script>
function openActivity()
{
var oSafeURL = new SafeURL("Link-Attachment.Test");
openUrlInWindow(oSafeURL.toURL(), 'popup', 'width=850,height=350,left=100,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no');
}
</script>
(or)
To call an activity using java script :
1) var bSafeURL= new SafeURL("A-B-C.ActivityName");
bSafeURL.put("param1",value1);
bSafeURL.put("param1",value2);
pega.util.Connect.asyncRequest('GET', bSafeURL.toURL(),'');
2) var oSafeURL = new SafeURL("@baseclass.testActivity");
oSafeURL.put("ClassName", insName);
var strRuleXml = httpRequestAsynch( oSafeURL.toURL(), null, 50, 100);
apart from there there lot other ways to do it.
Some ways that we can achive a call to activity and open popup window / model window:
1)
var pxReqURI = pxRequestor.pxReqURI;
openUrlInWindow(pxReqURI + "?pyActivity=A-B-C.ActivityName&Param1=" + value1, "InteractionData", "status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,left=192,top=51.2,height=500,width=800");
2)
activityURL = "<pega:reference name="pxRequestor.pxReqURI" mode="normal"/>?pyActivity=Work-myActivity&myParameterName=" + valueToPass;
windowOptions = "width:500;height:600;resizable: yes; scroll: yes; help: no";
openUrlInWindow(activityURL,"WINDOWNAME",windowOptions,false);
3) var strWindowName = "Popup window title";
var objSafeUrl = new SafeURL("A-B-C.Activity Name");
var contentWin = showModalDialog(objSafeUrl.toURL(), strWindowName , "width:500;height:600;resizable: yes; scroll: yes; help: no;");
4) var objSafeUrl = new SafeURL("A-B-C.Activity Name");
windowOptions = "width:500;height:600;resizable: yes; scroll: yes; help: no";
openUrlInWindow(objSafeUrl .toURL(),"WINDOWNAME",windowOptions,false);
Javascripts use to open in new window:
<script>
function ExportExcel(){
var windowProps = 'toolbar=no,location=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,width=750,height=600';
var URL = new SafeURL("ClassName.ActivityName"); //Replace ClassName with name of the Applies To class and ActivityName with name of your export activity
url = URL.toURL();
window.open(url,"_self", windowProps);
}
</script>
To Call Activity from Java Script:
For calling activity from Javascript, there is already a thread ..You have to use 'SafeUrl' and httpRequestAsync function in script.
<script>
function openActivity()
{
var oSafeURL = new SafeURL("Ecorp-Report.TestActivity");
openUrlInWindow(oSafeURL, 'popup', 'width=850,height=350,left=100,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no');
}
</script>
(or)
<script>
function openActivity()
{
var oSafeURL = new SafeURL("Link-Attachment.Test");
openUrlInWindow(oSafeURL.toURL(), 'popup', 'width=850,height=350,left=100,scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no');
}
</script>
(or)
To call an activity using java script :
1) var bSafeURL= new SafeURL("A-B-C.ActivityName");
bSafeURL.put("param1",value1);
bSafeURL.put("param1",value2);
pega.util.Connect.asyncRequest('GET', bSafeURL.toURL(),'');
2) var oSafeURL = new SafeURL("@baseclass.testActivity");
oSafeURL.put("ClassName", insName);
var strRuleXml = httpRequestAsynch( oSafeURL.toURL(), null, 50, 100);
apart from there there lot other ways to do it.
Some ways that we can achive a call to activity and open popup window / model window:
1)
var pxReqURI = pxRequestor.pxReqURI;
openUrlInWindow(pxReqURI + "?pyActivity=A-B-C.ActivityName&Param1=" + value1, "InteractionData", "status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,left=192,top=51.2,height=500,width=800");
2)
activityURL = "<pega:reference name="pxRequestor.pxReqURI" mode="normal"/>?pyActivity=Work-myActivity&myParameterName=" + valueToPass;
windowOptions = "width:500;height:600;resizable: yes; scroll: yes; help: no";
openUrlInWindow(activityURL,"WINDOWNAME",windowOptions,false);
3) var strWindowName = "Popup window title";
var objSafeUrl = new SafeURL("A-B-C.Activity Name");
var contentWin = showModalDialog(objSafeUrl.toURL(), strWindowName , "width:500;height:600;resizable: yes; scroll: yes; help: no;");
4) var objSafeUrl = new SafeURL("A-B-C.Activity Name");
windowOptions = "width:500;height:600;resizable: yes; scroll: yes; help: no";
openUrlInWindow(objSafeUrl .toURL(),"WINDOWNAME",windowOptions,false);
No comments:
Post a Comment