AJAX

AJAX functionality is provided by DWR and Script.aculo.us libraries. DWR is used mainly in editing record values, creating and editing patient id's, and the partograph .

DWR Notes:

  • ZEPRS was designed without suport for cookies so that multiple users could browse different patient records using tabs in Firefox. DWR version 1.x does not support cookie-less session; therefore, engine.js is pasted into a .jsp file thereby becoming /js/engine2.jsp, with the following changes:
    • The partograph dropdown widget uses the value for jessionid created at the top of engine2.jsp:
      jsessionid= <%="'"+session.getId()+"'"%>
    • Add the following line after urlPostfix is set:
      urlPostfix += ";jsessionid=" + <%="'"+session.getId()+"'"%>
  • If a session times out, the current page needs to be refreshed so that the user may login again. The following line is added to /js/engine2,jsp after the DWREngine.setTextHtmlHandler function is created:
     DWREngine.setTextHtmlHandler(function() { document.location.reload(); });
  • If you add a new property to a class - especially in the Form Administration section - and it doesn't update, you may need to modify the settings in one of the dwr-related xml config files. here's a list of these files:
    • /WEB-INF/dwr-dyna-admin.xml - for Dynasite administration. If you add a new field to PageItem that can be edited in the admin interface, then you'll need to update the bean converter for PageItem in this file.
    • /WEB-INF/dwr-display.xml - for Widget display when editing a form value
    • /WEB-INF/dwr-patient.xml - creaintg PatientId, newborns, etc.
    • /WEB-INF/dwr-useradmin.xml - Adding users to ZEPRS.

Script.aculo.us notes:

  • This AJAX lib is used primarily in the Form field selection widget in the Administrative section for ZEPRS. Screenshots are available.