Screen-level event handler
The Presentation Framework uses the onlaod
event on document.body. All
other events are available for your use.
The Presentation Framework uses the attachEvent() function to dynamically attach event handlers to other events (for example, onblur on input). Therefore, in your JSP code, you can use other functions. If you want to invoke your own onload function, you can still use the attachEvent() function inside a script tag in your JSP as follows:
<script language=jscript src="/extensions/global/webpages/scripts/om.js">
</script>
<script language=jscript>
window.document.body.attachEvent("onload", myFunc)
</script>
This causes the myFunc() function to run when the HTML is loaded. Note that the body of the myFunc function must exist within the INSTALL_DIR/extensions/global/webpages/scripts/om.js file.
The Presentation Framework calls the Save action for a detail view when the Save icon is clicked. If you want to plug in your own custom event handler for this event, configure the action to call your JavaScript function. The function needs to be present in the INSTALL_DIR/extensions/global/webpages/scripts/extn.js file.
The Presentation Framework invokes the list view when the Search icon is clicked in a search view. If you want to plug in your own custom event handler for this event, attach your JavaScript function to the onclick event of the object returned by the yfcGetSearchHandle() JavaScript API when the page is loaded. The example below shows how to do this:
<script language=jscript src="/extensions/global/webpages/scripts/om.js">
</script>
<script language=jscript>
//Get the handle to search button.
var oObj = yfcGetSearchHandle();
//The setParentKey function is defined inside om.js.
var sVal = oObj.attachEvent("onclick",setParentKey);
</script>