← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3621: Load Beneficiary Attribute module by ajax ( patient module ).

 

------------------------------------------------------------
revno: 3621
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-16 13:44:39 +0700
message:
  Load Beneficiary Attribute module by ajax ( patient module ).
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-05-16 05:05:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-05-16 06:44:39 +0000
@@ -201,7 +201,14 @@
 			<param name="page">
 				/dhis-web-maintenance-patient/patientAttribute.vm</param>
 			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/patientAttribute.js</param>
+			<param name="javascripts">javascript/commons.js,javascript/patientAttribute.js</param>
+		</action>
+		
+		<action name="patientAttributeList"
+			class="org.hisp.dhis.patient.action.patientattribute.GetPatientAttributeListAction">
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">
+				/dhis-web-maintenance-patient/patientAttributeList.vm</param>
 		</action>
 
 		<action name="getPatientAttribute"
@@ -220,36 +227,28 @@
 
 		<action name="addPatientAttribute"
 			class="org.hisp.dhis.patient.action.patientattribute.AddPatientAttributeAction">
-			<result name="success" type="redirect">patientAttribute.action
-			</result>
+			<result name="success" type="velocity-json">
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
 		</action>
 
 		<action name="showAddPatientAttributeForm" class="org.hisp.dhis.patient.action.NoAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">
-				/dhis-web-maintenance-patient/addPatientAttributeForm.vm</param>
-			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/patientAttribute.js</param>
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-patient/addPatientAttributeForm.vm</param>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_ADD</param>
 		</action>
 
 		<action name="showUpdatePatientAttributeForm"
 			class="org.hisp.dhis.patient.action.patientattribute.GetPatientAttributeAction">
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">
-				/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm</param>
-			<param name="menu">/dhis-web-maintenance-patient/patientAndProgramMenu.vm</param>
-			<param name="javascripts">javascript/patientAttribute.js
-				,../dhis-web-commons/javascripts/jQuery/ui/jquery.cluetip.min.js</param>
-			<param name="stylesheets">../dhis-web-commons/javascripts/jQuery/ui/css/theme/jquery.cluetip.css</param>
+			<result name="success" type="velocity">/content.vm</result>
+			<param name="page">/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm</param>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
 		</action>
 
 		<action name="updatePatientAttribute"
 			class="org.hisp.dhis.patient.action.patientattribute.UpdatePatientAttributeAction">
-			<result name="success" type="redirect">patientAttribute.action
-			</result>
+			<result name="success" type="velocity-json">
+				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 			<param name="requiredAuthorities">F_PATIENTATTRIBUTE_UPDATE</param>
 		</action>
 
@@ -259,7 +258,6 @@
 				/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 			<result name="input" type="velocity-json">
 				/dhis-web-commons/ajax/jsonResponseInput.vm</result>
-			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 
 		<action name="removePatientAttributeOption"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2011-05-13 09:43:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm	2011-05-16 06:44:39 +0000
@@ -1,34 +1,35 @@
-<script type="text/javascript">
-	jQuery(document).ready(	function(){
-		validation( 'addPatientAttributeForm', function(form){
-			if( isSubmit && ATTRIBUTE_OPTION.checkOnSubmit() ) {
-				form.submit(i18n_field_is_required);
-			}
-		}, function(){
-			isSubmit = true;
-			
-			var fields = jQuery("#addPatientAttributeForm").serializeArray();
-			jQuery.each(fields, function(i, field) {
-				if(  field.name.match("^attrOption")=='attrOption' && field.value == ""){
-					setInnerHTML("attrMessage", i18n_field_is_required);
-					isSubmit = false;
+<script>
+	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
+	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
+	var isSubmit = true;
+	jQuery("#addPatientAttributeForm").ready( function(){
+			validation( 'addPatientAttributeForm', function(form){
+				if( isSubmit && ATTRIBUTE_OPTION.checkOnSubmit() ) {
+					form.submit(i18n_field_is_required);
 				}
-			});
-		}); 
+			}, function(){
+				isSubmit = true;
+				
+				var fields = $("#addPatientAttributeForm").serializeArray();
+				jQuery.each(fields, function(i, field) {
+					if(  field.name.match("^attrOption")=='attrOption' && field.value == ""){
+						setInnerHTML("attrMessage", i18n_field_is_required);
+						isSubmit = false;
+					}
+				});
+			}); 
+			
 		
 		jQuery("#attributeComboRow").hide();
 			
 		checkValueIsExist( "name", "validatePatientAttribute.action");
 	});		
-
-	var i18n_remove_option = '$encoder.jsEscape( $i18n.getString( "remove_option" ) , "'") ';
-	var i18n_field_is_required = '$encoder.jsEscape( $i18n.getString( "field_is_required" ) , "'") ';
-	var isSubmit = true;
 </script>
-
-																		
+				
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
+													
 <h3>$i18n.getString( "add_new_patient_attribute" )</h3>
-<form id="addPatientAttributeForm" action="addPatientAttribute.action" method="post" >
+<form id="addPatientAttributeForm" method="post">
 
 <table id="attrTable"> 
 	<thead>
@@ -101,10 +102,8 @@
     </tr>
      </tbody>
 </table>
-<span id='message'></span>
 <p>
-    <input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
-    <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='patientAttribute.action'" style="width:10em"/>
+    <input type="button" value="$i18n.getString( 'add' )" style="width:10em" onclick="addPatientAttribute();"/>
 </p>
 
 </form>   

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-05-13 09:11:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patient.js	2011-05-16 06:44:39 +0000
@@ -730,7 +730,6 @@
       url: 'addPatient.action',
       data: getParamsForDiv('addPatientDiv'),
       success: function(json) {
-		var type = json.response;
 		showProgramEnrollmentSelectForm( json.message );
       }
      });

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2011-04-27 05:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/patientAttribute.js	2011-05-16 06:44:39 +0000
@@ -27,6 +27,7 @@
 // -----------------------------------------------------------------------------
 // Remove Patient Attribute
 // -----------------------------------------------------------------------------
+
 function removePatientAttribute( patientAttributeId, name )
 {
 	removeItem( patientAttributeId, name, i18n_confirm_delete, 'removePatientAttribute.action' );	
@@ -98,4 +99,90 @@
 	{
 		return "<tr><td><input type='text' name='attrOptions' style='width:28em'/><a href='#' style='text-decoration: none; margin-left:0.5em;' title='"+i18n_remove_option+"'  onClick='ATTRIBUTE_OPTION.remove(this,null)'>[ - ]</a></td></tr>";
 	}
-}
\ No newline at end of file
+}
+
+// ------------------------------------------------------------------
+// Add Patient-attribute
+// ------------------------------------------------------------------
+
+function showAddPatientAttributeForm()
+{
+	hideById('attributeList');
+	jQuery('#loaderDiv').show();
+	jQuery('#editPatientAttributeForm').load('showAddPatientAttributeForm.action',
+	{
+	}, function()
+	{
+		showById('editPatientAttributeForm');
+		jQuery('#loaderDiv').hide();
+	});
+}
+
+function addPatientAttribute()
+{	
+	$.ajax({
+		type: "POST",
+		url: 'addPatientAttribute.action',
+		data: getParamsForDiv('editPatientAttributeForm'),
+		success: function( json ) {
+			if( json.response == 'success')
+			{
+				onClickBackBtn();
+			}
+		}
+	});
+	
+    return false;
+}
+
+// ------------------------------------------------------------------
+// Show Update Patient-attribute
+// ------------------------------------------------------------------
+
+function showUpdatePatientAttributeForm( attributeId )
+{
+	hideById('attributeList');
+	jQuery('#loaderDiv').show();
+	jQuery('#editPatientAttributeForm').load('showUpdatePatientAttributeForm.action',
+	{
+		id:attributeId
+	}, function()
+	{
+		showById('editPatientAttributeForm');
+		jQuery('#loaderDiv').hide();
+	});
+	
+}
+
+function updatePatientAttribute()
+{
+	$.ajax({
+		type: "POST",
+		url: 'updatePatientAttribute.action',
+		data: getParamsForDiv('editPatientAttributeForm'),
+		success: function( json ) {
+			if( json.response == 'success')
+			{
+				onClickBackBtn();
+			}
+		}
+	});
+    return false;
+}
+
+// ------------------------------------------------------------------
+// Click Back button
+// ------------------------------------------------------------------
+
+function onClickBackBtn()
+{
+	hideById('editPatientAttributeForm');	
+	jQuery('#loaderDiv').show();
+	jQuery('#attributeList').load('patientAttributeList.action',
+	{
+	}, function()
+	{
+		showById('attributeList');
+		jQuery('#loaderDiv').hide();
+	});
+}	
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttribute.vm	2011-05-16 06:44:39 +0000
@@ -1,64 +1,12 @@
-
-<h3>$i18n.getString( "patient_attribute_management" )</h3>
-
-<table class="mainPageTable">
-  <tr>
-    <td style="vertical-align:top">
-    
-      <table class="listTable">
-          <col>          
-          <col width="20">
-          <col width="20">
-          <col width="20">          		  
-		  <tr>
-		  	<td></td>
-			<td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( "add_new" )" onclick="window.location.href='showAddPatientAttributeForm.action'" style="width:70px"></td>
-		  </tr>
-          <tr>
-            <th>$i18n.getString( "attribute_name" )</th>
-            <th colspan="3">$i18n.getString( "operations" )</th>
-          </tr>
-
-          <tbody id="list">
-            #foreach( $patientAttribute in $patientAttributes )
-              <tr id="tr${patientAttribute.id}">
-              
-                <td>$encoder.htmlEncode( $patientAttribute.name )</td>                
-                
-                <td style="text-align:center">
-                  <a href="showUpdatePatientAttributeForm.action?id=$patientAttribute.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
-                </td>                
- 
-                <td style="text-align:center">
-                  <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
-                </td>            
-                
-                <td style="text-align:center">
-                  <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
-                </td>
-                
-              </tr>
-			#end
-
-          </tbody>
-
-        </table>
-    </td>
-		<td style="width:20em; padding-left:2em; vertical-align:top">
-
-			<div id="detailsArea" style="display:none">
-				<div style="float:right">
-					<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
-				</div>				
-				<p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
-                <p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
-                <p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
-                <p><label>$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
-			</div>
-
-		</td>
-  </tr>
-</table>
+<div id='attributeList'>
+	#parse( "/dhis-web-maintenance-patient/patientAttributeList.vm" )
+</div>
+
+#parse( "/dhis-web-commons/loader/loader.vm" )
+
+<div id='editPatientAttributeForm'></div>
+<p></p>
+<span id='message' style='display:none;' onclick="hideById(this.id)"> $i18n.getString( "save_success" )</span>
 
 <script type="text/javascript">
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_patient_attribute" ) , "'" )';

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeList.vm	2011-05-16 06:44:39 +0000
@@ -0,0 +1,62 @@
+<h3>$i18n.getString( "patient_attribute_management" )</h3>
+
+<table class="mainPageTable">
+  <tr>
+	<td style="vertical-align:top">
+	
+	  <table class="listTable">
+		  <col>          
+		  <col width="20">
+		  <col width="20">
+		  <col width="20">          		  
+		  <tr>
+			<td></td>
+			<td colspan="3" style="text-align:right"><input type="button" value="$i18n.getString( 'add_new' )" onclick="javascript:showAddPatientAttributeForm();" style="width:70px"></td>
+		  </tr>
+		  <tr>
+			<th>$i18n.getString( "attribute_name" )</th>
+			<th colspan="3">$i18n.getString( "operations" )</th>
+		  </tr>
+
+		  <tbody id="list">
+			#set( $mark = false )
+			#foreach( $patientAttribute in $patientAttributes )
+			  <tr id="tr${patientAttribute.id}" #alternate( $mark )>
+			  
+				<td>$encoder.htmlEncode( $patientAttribute.name )</td>                
+				
+				<td style="text-align:center">
+				  <a href="javascript:showUpdatePatientAttributeForm('$patientAttribute.id');" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
+				</td>                
+ 
+				<td style="text-align:center">
+				  <a href="javascript:removePatientAttribute( '$patientAttribute.id', '$encoder.jsEncode( $patientAttribute.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+				</td>            
+				
+				<td style="text-align:center">
+				  <a href="javascript:showPatientAttributeDetails( $patientAttribute.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a>
+				</td>
+				
+			  </tr>
+			  #set( $mark = !$mark)
+			#end
+
+		  </tbody>
+
+		</table>
+	</td>
+		<td style="width:20em; padding-left:2em; vertical-align:top">
+
+			<div id="detailsArea" style="display:none">
+				<div style="float:right">
+					<a href="javascript:hideDetails()" title="$i18n.getString( "hide_details" )"><img src="../images/close.png" alt="$i18n.getString( "hide_details" )"></a>
+				</div>				
+				<p><label>$i18n.getString( "id" ):</label><br><span id="idField"></span></p>
+				<p><label>$i18n.getString( "name" ):</label><br><span id="nameField"></span></p>
+				<p><label>$i18n.getString( "description" ):</label><br><span id="descriptionField"></span></p>
+				<p><label>$i18n.getString( "value_type" ):</label><br><span id="valueTypeField"></span></p>
+			</div>
+
+		</td>
+  </tr>
+</table>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-05-13 09:43:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-05-16 06:44:39 +0000
@@ -1,84 +1,68 @@
-<script type="text/javascript">
-	jQuery(document).ready(function() {
-		jQuery("#tabs").tabs();
-		datePickerValid( 'birthDate' );
-			
-		jQuery("#searchForm").validate({
-			meta:"validate"
-			,errorElement:"span"
-			,submitHandler: function(form) { searchPerson(); }
-			,rules : {
-				relationshipTypeId  : { required: true },
-				searchType			: { required: true },
-				searchValue			: { required: true }
-			}
-		});
-
-		jQuery("#addRepresentativeForm").validate({
-			 meta:"validate"
-			,errorElement:"td"
-			,submitHandler: function(form) { validateAddRepresentative(); }
-			,rules : {
-				relationshipTypeId  : { required: true },
-				fullName : {required:true,rangelength:[7,50], unicodechars:true},
-				gender : { required: true },
-				birthDate :{required:false,dateISO:true,datelessthanequaltoday:true}
-			},beforeValidateHandler: function(form)
+<script>
+jQuery(document).ready(function()
+{
+	jQuery("#tabs").tabs();
+	datePickerValid( 'birthDate' );
+	
+	jQuery("#searchForm").validate({
+		meta:"validate"
+		,errorElement:"span"
+		,submitHandler: function(form)
+						{
+							searchPerson();
+						}
+		,rules : {
+			relationshipTypeId  : { required: true },
+			searchType			: { required: true },
+			searchValue		: { required: true }
+		}
+	});
+	
+	
+	jQuery("#addRepresentativeForm").validate({
+		 meta:"validate"
+		,errorElement:"td"
+		,submitHandler: function(form)
+						{
+							validateAddRepresentative();
+						}
+		,rules : {
+			relationshipTypeId  : { required: true },
+			fullName : {required:true,rangelength:[7,50], unicodechars:true},
+			gender : { required: true },
+			birthDate :{required:false,dateISO:true,datelessthanequaltoday:true}
+		},beforeValidateHandler: function(form)
+			{
+				var dobType = $('#dobType').val();
+						
+				if( dobType=='V' || dobType=='D' ) 
 				{
-					var dobType = jQuery('#dobType').val();
-
-					if( dobType=='V' || dobType=='D' ) 
-					{
-						var birthDate = jQuery('#birthDate').val();
-						if( birthDate != '' ){
-							jQuery("#memberValidator").val(birthDate);
-						}
-					}else{
-						var age = jQuery('#age').val();
-						jQuery("#memberValidator").val(age);
+					var birthDate = $('#birthDate').val();
+					if( birthDate != '' ){
+						$("#memberValidator").val(birthDate);
 					}
+				}else{
+					var age = $('#age').val();
+					$("#memberValidator").val(age);
 				}
-
-		});
-
-		// Esc key for jQuery thickbox
-		// jQuery thickbox already has this event
-		// but somehow it's over written by jQuery tabs plugin
-		document.onkeydown = function(e){ 	
-			if (e == null) { // ie
-				keycode = event.keyCode;
-			} else { // mozilla
-				keycode = e.which;
-			}
-
-			if(keycode == 27){ // close
-				window.parent.tb_remove();
-			}
-		}
-	}); 
-
-	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
-	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
-	var i18n_patient_fullName = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
-	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
-	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
-	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
-	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
-	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
-	var i18n_choose_this_person = '$encoder.jsEscape( $i18n.getString( "choose_this_patient" ) , "'")';
-	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
-	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';
-	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
-	var i18n_no_result = '$encoder.jsEscape( $i18n.getString( "no_result" ) , "'")';
-	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'")';
-	var i18n_please_enter_value = '$encoder.jsEscape( $i18n.getString( "please_enter_value" ) , "'")';
-	var i18n_please_select_search_type = '$encoder.jsEscape( $i18n.getString( "please_select_search_type" ) , "'")';
-	var i18n_please_select_identifier_type = '$encoder.jsEscape( $i18n.getString( "please_select_identifier_type" ) , "'")';
-	var i18n_please_select_attribute_type = '$encoder.jsEscape( $i18n.getString( "please_select_attribute_type" ) , "'")';
-	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
-	var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_select_relationshipType" ) , "'")';
-	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
-	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
+			}
+	});
+	
+	// Esc key for jQuery thickbox
+	// jQuery thickbox already has this event
+	// but somehow it's over written by jQuery tabs plugin
+	document.onkeydown = function(e){ 	
+		if (e == null) { // ie
+			keycode = event.keyCode;
+		} else { // mozilla
+			keycode = e.which;
+		}
+		if(keycode == 27){ // close
+			window.parent.tb_remove();
+		}
+	}
+}); 
+
 </script>
 
 <!-- TAB Header -->
@@ -276,4 +260,29 @@
 		</div>
 	</div>
 </div>
+<script>
+
+	var i18n_patient_identifiers = '$encoder.jsEscape( $i18n.getString( "patient_identifiers" ) , "'")';
+	var i18n_patient_attributes = '$encoder.jsEscape( $i18n.getString( "patient_attributes" ) , "'")';
+	var i18n_patient_fullName = '$encoder.jsEscape( $i18n.getString( "full_name" ) , "'")';
+	var i18n_patient_demographics = '$encoder.jsEscape( $i18n.getString( "demographics" ) , "'")';
+	var i18n_patient_gender = '$encoder.jsEscape( $i18n.getString( "gender" ) , "'")';
+	var i18n_patient_date_of_birth = '$encoder.jsEscape( $i18n.getString( "date_of_birth" ) , "'")';
+	var i18n_patient_age = '$encoder.jsEscape( $i18n.getString( "age" ) , "'")';
+	var i18n_patient_blood_group = '$encoder.jsEscape( $i18n.getString( "blood_group" ) , "'")';
+	var i18n_choose_this_person = '$encoder.jsEscape( $i18n.getString( "choose_this_patient" ) , "'")';
+	var i18n_no_duplicate_found = '$encoder.jsEscape( $i18n.getString( "no_duplicate_found" ) , "'")';
+	var i18n_patient_system_id = '$encoder.jsEscape( $i18n.getString( "patient_system_id" ) , "'")';
+	var i18n_child_representative = '$encoder.jsEscape( $i18n.getString( "child_representative" ) , "'")';
+	var i18n_no_result = '$encoder.jsEscape( $i18n.getString( "no_result" ) , "'")';
+	var i18n_error_connect_to_server = '$encoder.jsEscape( $i18n.getString( "error_connect_to_server" ) , "'")';
+	var i18n_please_enter_value = '$encoder.jsEscape( $i18n.getString( "please_enter_value" ) , "'")';
+	var i18n_please_select_search_type = '$encoder.jsEscape( $i18n.getString( "please_select_search_type" ) , "'")';
+	var i18n_please_select_identifier_type = '$encoder.jsEscape( $i18n.getString( "please_select_identifier_type" ) , "'")';
+	var i18n_please_select_attribute_type = '$encoder.jsEscape( $i18n.getString( "please_select_attribute_type" ) , "'")';
+	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
+	var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_select_relationshipType" ) , "'")';
+	var i18n_no_patients_found = '$encoder.jsEscape( $i18n.getString( "no_patients_found" ) , "'")';
+	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
+</script>
 	

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2011-01-20 15:25:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientAttibuteForm.vm	2011-05-16 06:44:39 +0000
@@ -26,10 +26,11 @@
 	});		
 </script>
 
+<input type="button" value="$i18n.getString( 'back' )" onclick="javascript:onClickBackBtn();" style="width:10em">
 
 <h3>$i18n.getString( "update_patient_attribute" )</h3>
 
-<form id="updatePatientAttributeForm" name="updatePatientAttributeForm" action="updatePatientAttribute.action" method="post" >
+<form id="updatePatientAttributeForm" name="updatePatientAttributeForm" method="post">
 
 <div style="display:inline">
   <input type="hidden" id="id" name="id" value="$patientAttribute.id">
@@ -116,8 +117,7 @@
   </table>  
 
 <p>
-    <input type="submit" value="$i18n.getString( "update" )" style="width:10em">
-    <input type="button" value="$i18n.getString( "cancel" )" onclick="window.location.href='patientAttribute.action'" style="width:10em">
+    <input type="button" value="$i18n.getString( "update" )" style="width:10em" onclick='updatePatientAttribute();'>
 </p>
 
 </form>