Run JavaScript on your PeopleSoft pages conditionally
This is not as simple as dropping a HTML Area on your page and setting the script in PeopleCode. This is because the value in the HTML Area field remains and the JavaScript code will keep executing at subsequent page refreshes.
Steps:
Lets have a derived/work record TEST_WRK And field HTMLAREA (TEST_WRK – HTMLAREA).
<input type="hidden" name="USERJSINJECTION" value=""/>
<script type="text/javascript">
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
function user_function1() {
window.open("","toolbar = no");
}
function user_function2() {
alert('Hello from user javascript');
}
addLoadEvent(function() {
%bind(:1)
});
</script>
2. At the scroll level 0 of your PS page, insert a HTML Area control. Assign this to the TEST_WRK.HTMLAREA field.
3. Again at scroll level 0 of your page, insert an editbox and assign this again to TEST_WRK.HTMLAREA. And Set the Following Field Property
a. On the Use tab, check Invisible and Modifiable by JavaScript.
b. On the General tab, set Page Field Name to USERJSINJECTION.
4. Now in PeopleCode, to execute your javascript function.
GetLevel0()(1).TEST_WRK.HTMLAREA.Value = GetHTMLText(HTML.TESTJS, "user_function1()");
Run JavaScript on your PeopleSoft pages conditionally的更多相关文章
- SharePoint JavaScript API in application pages
前言 最近,在SharePoint 应用程序页中写JavaScript API,进行一些数据交互.其实,很简单的事情却遇到了问题,记录一下,希望能对遇到类似问题的人以帮助. 引用JavaScript ...
- ASP.NET postback with JavaScript (UseSubmitBehavior)
ASP.NET postback with JavaScript Here is a complete solution Entire form tag of the asp.net page < ...
- .net 开源 JavaScript 解析引擎
1. Javascript .NET 地址为:http://javascriptdotnet.codeplex.com/ 使用方法: Quick Start This section provides ...
- Dynamic Prompt Table for Record Field on PeopleSoft Page
Sometimes a situation in project work arises to have a dynamic prompt table for record fields on Peo ...
- Creating Help Pages for ASP.NET Web API -摘自网络
When you create a web API, it is often useful to create a help page, so that other developers will k ...
- JavaScript 模块化历程
这是一篇关于js模块化历程的长长的流水账,记录js模块化思想的诞生与变迁,展望ES6模块化标准的未来.经历过这段历史的人或许会感到沧桑,没经历过的人也应该知道这段历史. 无模块时代 在ajax还未提出 ...
- 2018年你需要知道的13个JavaScript工具库
译者按: 你可能已经用到Underscore或者Lodash.本文列举了13个常用的JavaScript工具库来提高开发效率. 原文: 11 Javascript Utility Libraries ...
- JavaScript 第一章总结
A quick dip into javascipt The way JavaScript works HTML 用一系列的 markup 来呈现整个 content 的 structure.CSS ...
- Java,JavaScript,jQuery,jSP,js
js是javascript文件的文件后缀,就像 a.txt 这个.txt是后缀一样 jsp是jsp网页文件的后缀,而jsp是java web 的表现层的一种技术 jquery 是一个函数库,基于jav ...
随机推荐
- expdp和impdp的用法
源地址:http://blog.chinaunix.net/uid-23622436-id-2394094.html
- crm plugin 未能加载文件或程序集“xxxx,”或它的某一个依赖项。系统找不到指定的文件。
plugin运行出错. 1 plugin文件如果是 注册到disk,应该是注册到 C:\Program Files\Microsoft Dynamics CRM\Server\bin\assembl ...
- 微信用户授权,取openid
var appid = "wxb5f2540cff5c72be"; var secret = "3de016d0c294b82a5c74ce3fc4865271" ...
- 关于在页面总嵌入iframe,ifram中发起请求,服务器端的session为空问题解决
本文抄袭:http://blog.csdn.net/ray_adon/article/details/6960724 在做项目是 是用了iframe,iframe发起ajax请求,服务器端报sessi ...
- java中的xml与实体类之间的映射
实体类: package xml; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class User ...
- nyoj 71 独木舟上的旅行
点击打开链接 独木舟上的旅行 时间限制:3000 ms | 内存限制:65535 KB 难度: 描述 进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别.一条独木舟最多只能乘坐两个人 ...
- Spring定时任务配置
可参照http://gong1208.iteye.com/blog/1773177 的详细配置 <!-- 系统定时任务工厂类 --> <bean id="systemDes ...
- Java中List转数组,必须带个参数
public static void main(String[] args) { List<String> lst = new ArrayList(); lst.add("赵云 ...
- Windows 2008下部署Exchange Server 2007
对于很多政府及企业来说,微软的邮件服务器Exchange Server都是一个不错的通信和协作平台选择,尤其新版邮件服务器Exchange Server 2007 和OCS的组合,在微软UC平台上创下 ...
- Appium小试
最近有空玩了一下Appium,记录一下 1.下载Appium for windows,现在是0.12.3版本 https://bitbucket.org/appium/appium.app/downl ...