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 ...
随机推荐
- Java基础-布局
- Linux php 中文乱码解决
在ubuntu下php网页输出乱码,在不涉及数据库编码的情况下: 修改“/etc/php5/apache2/php.ini”将 default_charset = "iso-8859-1&q ...
- [Java] 使用Comparator排序对象
package test.collections; import java.util.ArrayList; import java.util.Collection; import java.util. ...
- [Flex] ButtonBar系列——最后一个项目的样式设置
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...
- poj 1094 Sorting It All Out(nyoj 349)
点击打开链接 Sorting It All Out Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24544 Accep ...
- Xml语言
一.XML是什么?作用是什么? l XML ( eXtensible Markup Language )语言是一种可扩展的标记语言.其中的可扩展是相对HTML来说的.因为XML标签没有被预定义,需要 ...
- 出现win8.1蓝屏重启故障该如何解决?
出现win8.1蓝屏重启故障该如何解决?电脑出现win8.1蓝屏重启故障,系统提示“你的电脑遇到问题,需要重新启动,我们只收集某些错误信息,然后为你重新启动.”怎么解决?本教程为你提供了win8.1蓝 ...
- The init method
The init method is a special method that gets invoked when an object is instantiated. Its full name ...
- 关于 mysql 2003 客户端连接报错的处理方法
在连接到 mysql 数据库服务器时,有时会在客户端报出 2003 的错误代码,并提示: 无法连接到服务器,但服务器却可以 ping 通,可能的原因如下: 1.网络不通.检查能不能ping通. 2.防 ...
- 洛谷P1470 最长前缀 Longest Prefix
P1470 最长前缀 Longest Prefix 73通过 236提交 题目提供者该用户不存在 标签USACO 难度普及/提高- 提交 讨论 题解 最新讨论 求大神指导,为何错? 题目描述 在生 ...