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 ...
随机推荐
- [ActionScript 3.0] AS3 访问舞台上元件的方法
文档类: package { import flash.display.MovieClip; public class Main extends MovieClip { public function ...
- 异步任务神器 Celery 简明笔记
转自:http://www.jianshu.com/p/1840035cb510 异步任务 异步任务是web开发中一个很常见的方法.对于一些耗时耗资源的操作,往往从主应用中隔离,通过异步的方式执行.简 ...
- js注意事项
在数组顶部插入一条数据 data.result.unshift({ Value: 'all', Text: '请选择分类' }); 执行iframe中的javascript方法 window.fram ...
- 立体匹配:关于OpenCV读写middlebury网站的给定的视差并恢复三维场景的代码
Middlebury是每个研究立体匹配算法的人不可能不使用的网站,Middlebury提供了许多标准的测试库,这极大地推进了立体匹配算法的进展.Middlebury提供的标准库,其计算出的视差保存在后 ...
- flash 读取系统默认编码
java有类可以直接读取,但貌似flash没有. Charset.defaultCharset(); 但是浏览器里可以有. document.defaultCharset;//从当前的区域语言中获取默 ...
- nyoj 102 次方求摸 快速幂
点击打开链接 次方求模 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 求a的b次方对c取余的值 输入 第一行输入一个整数n表示测试数据的组数(n<100) 每组测 ...
- HTTP权威指南----缓存
缓存的处理步骤: 1.接收----缓存从网络中读取抵达的请求报文2.解析----缓存对报文进行解析,提取出URL和各种首部3.查询----缓存查看是否有本地副本可用,如果没有,就获取一份副本(并将其保 ...
- Android开发-API指南-<uses-library>
<uses-library> 英文原文:http://developer.android.com/guide/topics/manifest/uses-library-element.ht ...
- Android开发-API指南-Intent和Intent过滤器
Intents and Intent Filters 英文原文:http://developer.android.com/guide/components/intents-filters.html 采 ...
- 如何查看IIS并发连接数
如果要想知道确切的当前网站IIS连接数的话,最有效的方法是通过windows自带的系统监视器来查看. 一.运行-->输入"perfmon.msc". 二.在"系统监 ...