Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 4914

Show
Ignore:
Timestamp:
07/11/08 22:15:04 (6 months ago)
Author:
sunbiz
Message:

registration: Fixed Search Servlet with POST & jQuery Changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/registration/metadata/moduleApplicationContext.xml

    r4904 r4914  
    1010            <props> 
    1111                   <prop key="module/@MODULE_ID@/registration.form">registrationForm</prop> 
    12                    <prop key="module/@MODULE_ID@/newPatient.form">newPatientForm</prop> 
     12                   <prop key="module/@MODULE_ID@/registerPatient.form">registerPatient</prop> 
    1313            </props> 
    1414        </property> 
     
    2323                <property name="formView"><value>/module/@MODULE_ID@/registrationForm</value></property> 
    2424    </bean> 
    25     <bean id="newPatientForm" class="@MODULE_PACKAGE@.web.controller.NewPatientFormController"> 
    26                 <property name="sessionForm"><value>true</value></property> 
    27                 <property name="commandName"><value>newPatientForm</value></property> 
    28                 <property name="successView"><value>newPatient.form</value></property> 
    29                 <property name="formView"><value>/module/@MODULE_ID@/newPatientForm</value></property> 
     25    <bean id="registerPatient" class="@MODULE_PACKAGE@.web.controller.RegisterPatientFormController"> 
     26                <property name="commandName"><value>registerPatient</value></property> 
     27                <property name="successView"><value>registerPatient.form</value></property> 
     28                <property name="formView"><value>/module/@MODULE_ID@/registerPatient</value></property> 
    3029    </bean> 
    3130         
  • openmrs-modules/registration/web/module/registerPatient.jsp

    r4904 r4914  
    1 <%--  
    2     Document   : registerPatient 
    3     Created on : 10 Jul, 2008, 2:37:55 PM 
    4     Author     : Sunbon 
    5 --%> 
    6  
    7 <%@page contentType="text/html" pageEncoding="UTF-8"%> 
    8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    9    "http://www.w3.org/TR/html4/loose.dtd"> 
    10  
    11 <html> 
    12     <head> 
    13         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
    14         <title>JSP Page</title> 
    15     </head> 
    16     <body> 
    17         <h2>Hello World!</h2> 
    18     </body> 
    19 </html> 
     1<%@ include file="/WEB-INF/template/include.jsp"%> 
     2<%@ include file="/WEB-INF/template/header.jsp"%> 
     3<h2>Do you want to register a patient?</h2> 
     4<%@ include file="/WEB-INF/template/footer.jsp"%> 
  • openmrs-modules/registration/web/module/registrationForm.jsp

    r4904 r4914  
    5454    <div class="box"> 
    5555        <spring:message code="registration.msg.registerInstructions" /><br/><br/> 
    56         <form method="post" onsubmit="return validateRegistration()" action="registerPatient.htm"> 
     56        <form method="post" onsubmit="return validateRegistration()" action="registerPatient.form"> 
    5757            <table> 
    5858                <tbody> 
  • openmrs-modules/registration/web/module/resources/scripts/registration.js

    r4904 r4914  
    2525 
    2626$(document).ready(function() { 
    27     $("#i18n").datepicker($.extend({},  
    28     $.datepicker.regional[''], {  
    29         showStatus: true,  
    30         showOn: "both",  
    31         buttonImage: "/openmrs/moduleResources/registration/images/calendar.gif",  
    32         buttonImageOnly: true  
    33     }));  
     27    $("#searchField").focus(); 
     28    $("#i18n").datepicker($.extend({}, 
     29        $.datepicker.regional[''], { 
     30            showStatus: true, 
     31            showOn: "both", 
     32            buttonImage: "/openmrs/moduleResources/registration/images/calendar.gif", 
     33            buttonImageOnly: true 
     34        })); 
    3435}); 
    3536 
     
    4647            return true; 
    4748        } 
    48         /*else if(ch==13){             
     49        /*else if(ch==13){ 
    4950            return true; 
    5051        }*/ 
     
    6061    var searchWord = $("#searchField").attr("value"); 
    6162    if(prevPhrase!=searchWord) 
    62         $("#searchResults").load('/openmrs/moduleServlet/registration/RegistrationSearchServlet?phrase='+searchWord); 
     63        $.ajax({ 
     64            type:"POST", 
     65            url:"/openmrs/moduleServlet/registration/RegistrationSearchServlet", 
     66            data:"phrase="+searchWord, 
     67            success: function(output){ 
     68                $("#searchResults").html(output); 
     69            } 
     70        }); 
    6371    loaded++; 
    6472    prevPhrase = searchWord; 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/RegisterPatientFormController.java

    r4904 r4914  
    2929 
    3030/** 
    31  * This controller backs the /web/module/registrationForm.jsp page. 
     31 * This controller backs the /web/module/registrationPatientForm.jsp page. 
    3232 * This controller is tied to that jsp page in the /metadata/moduleApplicationContext.xml file 
    3333 *  
    3434 */ 
    35 public class NewPatientFormController extends SimpleFormController { 
     35public class RegisterPatientFormController extends SimpleFormController { 
    3636 
    3737    /** Logger for this class and subclasses */ 
  • openmrs-modules/registration/web/src/org/openmrs/module/registration/web/controller/RegistrationSearchServlet.java

    r4901 r4914  
    146146    protected void doGet(HttpServletRequest request, HttpServletResponse response) 
    147147            throws ServletException, IOException { 
    148         processRequest(request, response); 
     148        //do Nothing... Can prevent XST 
     149        //processRequest(request, response); 
    149150    } 
    150151