← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4193: Ajax Request stuff don't work does not work with IE9 ( Patient module ).

 

------------------------------------------------------------
revno: 4193
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-07-22 11:01:32 +0700
message:
  Ajax Request stuff don't work does not work with IE9 ( Patient module ).
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js


--
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/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js	2011-05-19 08:12:45 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/validationcriteria.js	2011-07-22 04:01:32 +0000
@@ -13,20 +13,22 @@
 
 function showValidationCriteriaDetails( criteriaId )
 {
-    var request = new Request();
-    request.setResponseTypeXML( 'dataElement' );
-    request.setCallbackSuccess( validationCriteriaReceived );
-    request.send( 'getValidationCriteria.action?id=' + criteriaId );
+	$.ajax({
+		url: 'getValidationCriteria.action?id=' + criteriaId,
+		cache: false,
+		dataType: "xml",
+		success: validationCriteriaReceived
+	});
 }
 
 function validationCriteriaReceived( validationCriteria )
 {
-    setInnerHTML( 'nameField', getElementValue( validationCriteria, 'name' ) );
-    setInnerHTML( 'descriptionField', getElementValue( validationCriteria, 'description' ) );
+    setInnerHTML( 'nameField', $(validationCriteria).find('name').text() );
+    setInnerHTML( 'descriptionField', $(validationCriteria).find('description' ).text() );
 	
-	var property = getElementValue( validationCriteria, 'property' )
-	var operator = getElementValue( validationCriteria, 'operator' )
-	var	value = getElementValue( validationCriteria, 'value' )
+	var property = $(validationCriteria).find('property').text()
+	var operator = $(validationCriteria).find('operator').text()
+	var	value = $(validationCriteria).find('value').text()
 	
 	// get operator
 	if(operator == 0 ){
@@ -45,15 +47,19 @@
 // Show div to Add or Update Validation-Criteria
 // ----------------------------------------------------------------------------------------
 function showDivValue(){
+	
 	var propertyName = byId('property').value;
+	
 	hideDiv();
-	if(propertyName != ''){
+	
+	if(propertyName != '')
+	{
 		 var div = byId(propertyName + 'Div');
 		 div.style.display = 'block';
 		 
-		 if(propertyName == 'gender' || 
+		 if( propertyName == 'gender' || 
 			propertyName == 'dobType' || 
-			propertyName == 'bloodGroup'){
+			propertyName == 'bloodGroup' ){
 				
 			byId('operator').selectedIndex = 1;
 			disable('operator');
@@ -63,7 +69,8 @@
 	 }
 }
 
-function hideDiv(){
+function hideDiv()
+{
 	hideById('genderDiv');
 	hideById('integerValueOfAgeDiv');
 	hideById('birthDateDiv');