JavaScript Timer in PeopleTools
Synopsis
This lesson shows how to implement the JavaScript timer we did in the previous lesson, but this time within the PeopleTools framework.
- Create a throw-away page definition, placing controls on the page. Modify the General tab's Page Field Name to specify the html id
- Create a HTML definition to hold the actual JavaScript code. Modify it by removing the call to startTimer() function. Instead this will be called from the PageActivate event.
- The PageActivate event will load the JavaScript into the document, start the timer, and attach an onclick event onto the Pause button.
- Replace the JavaScript code to change the Pause button label with traditional PeopleCode.
Take Aways
The General Page Field name relates directly to the html id of the control in the resulting document
- AddJavaScript() will load a reference to a JavaScript program into the HTML document at load time.
- AddOnLoadScript() will execute a function at HTML document load
- JavaScriptEvents() can tie a JavaScript function to an onclick event
Download
Download
Download
Download