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 ...
随机推荐
- Android - 禁止Gridview滚动
设置gridview 的touch事件,是ACTION_MOVE 的话返回true mDragGrid.setOnTouchListener(new OnTouchListener() { @Over ...
- python中报错总结
python标准异常 异常名称 描述 BaseException 所有异常的基类 SystemExit 解释器请求退出 KeyboardInterrupt 用户中断执行(通常是输入^C) Ex ...
- 使用jaxp对比xml进行SAX解析
package cn.itcast.sax; import java.io.IOException; import javax.xml.parsers.ParserConfigurationExcep ...
- struts2常用的常量constant
常用的常量配置 struts.serve.static.browserCache 该属性设置浏览器是否缓存静态内容.当应用处于开发阶段时,我们希望每次请求都获得服务器的最新响应,则可设置该属性为fa ...
- 制作东皇3.2的安装U盘-黑苹果之路
每次使用硬盘映像安装需要先装windows,制作东皇3.2安装分区,再装bootthink,再通过bootthink加载东皇3.2的分区进行安装,非常繁琐.尝试制作U盘来直接安装东皇3.2.过程如下: ...
- Grunt 插件使用汇总
最近使用了很多 Grunt 插件,这里把使用 Grunt 中涉及的从开发.代码检查.单元测试.E2E 测试,直到发布所涉及的插件,做一个比较完全的汇总. 环境搭建 1. 创建 Web 前端开发环境 2 ...
- 【转】SQL Server 2008下载 (附注册码)
SQL Server 2008 中文试用版下载地址:http://sqlserver.dlservice.microsoft.com/dl/download/B/8/0/B808AF59-7619-4 ...
- oracle 大字段clob检索
select * from tab_name twhere dbms_lob.instr(t.daziduan, 'aaa', 1, 1) > 0;
- 洛谷P1198 [JSOI2008]最大数
P1198 [JSOI2008]最大数 267通过 1.2K提交 题目提供者该用户不存在 标签线段树各省省选 难度提高+/省选- 提交该题 讨论 题解 记录 最新讨论 WA80的戳这QwQ BZOJ都 ...
- noip2008 笨小猴
P1125 笨小猴 1.6K通过 3.7K提交 题目提供者该用户不存在 标签模拟2008NOIp提高组 难度普及- 提交该题 讨论 题解 记录 题目描述 笨小猴的词汇量很小,所以每次做英语选择题的 ...