Javascript
Calls to Javascript files follow this format:
<script language="JavaScript" type="text/javascript" src="/zeprs/js/zeprs.js;jsessionid=${pageContext.request.session.id}"></script>
The jsessionid is included in the call because without it, Tomcat 5.0 was spawning a new session on each access.
The main ZEPRS template, template.jsp, includes the following javascript files:
- js/browser_detect.js - browser detection. When ZEPRS coding started in 2003, this was a fairly good way to doing it. As IE6 disappears from the scene, it may become less necessary.
- js/fat.js - This is used for fades in DWR, when a value is updated. Not every page uses it, but all of the forms do.
- js/zeprs.js - The big ZEPRS lib.
- config/javascript.js - Calendar widget, courtesy of the Struts Layout tab library.
- js/validation.js - Struts validation, with some ZEPRS modifications. See validation.js page for more info
- dwr/util.js - DWR-related functions
- js/engine2.jsp - DWR-related functions.
The Newborn Evaluation form in ZEPRS summons the apgar.tag, which calls apgar.jsp, which in turn calls the apgar.js file.
DWR-related javascript - used for AJAX functions such as form value editing and Partograph form in ZEPRS:
- /zeprs/dwr/util.js
- /zeprs/js/engine2.jsp
- /zeprs/js/engine2.js
Forms that use DWR - especially when editing values - need to preload some javascript when the page is loaded in order to display a progress message. The struts action file sends in the request a "dwr" attribute, which is used in the template page to provide the correct onload javascript. The following struts action files set the dwr attribute: FormDisplayAction, PatientPuerAction (in ZEPRS) and ChartFormAction.
- Printer-friendly version
- Login to post comments
- PDF version