← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3070: BUG: remote validation not working correctly, will allow for names that already exists. Fixed.

 

------------------------------------------------------------
revno: 3070
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-03-18 13:12:14 +0100
message:
  BUG: remote validation not working correctly, will allow for names that already exists. Fixed.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/addSection.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editDataSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editSection.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-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/addSection.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/addSection.js	2011-03-17 12:08:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/addSection.js	2011-03-18 12:12:14 +0000
@@ -18,7 +18,7 @@
 	}, {
 		'beforeValidateHandler' : function()
 		{
-			selectAllById( 'selectedList' )
+			selectAllById( 'selectedList' );
 		},
 		'rules' : rules
 	} );
@@ -26,7 +26,13 @@
 	jQuery( "#sectionName" ).attr( "maxlength", r.section.name.length[1] );
 
 	checkValueIsExist( "sectionName", "validateSection.action", {
-		dataSetId : jQuery( "#dataSetId" ).val(),
-		name : jQuery( "#sectionName" ).val()
+		dataSetId : function()
+		{
+			return jQuery( "#dataSetId" ).val();
+		},
+		name : function()
+		{
+			return jQuery( "#sectionName" ).val();
+		}
 	} );
 } );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editDataSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editDataSet.js	2011-03-17 12:08:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editDataSet.js	2011-03-18 12:12:14 +0000
@@ -41,13 +41,23 @@
 	jQuery( "#code" ).attr( "maxlength", r.dataSet.code.length[1] );
 
 	checkValueIsExist( "name", "validateDataSet.action", {
-		dataSetId : jQuery( "#dataSetId" ).val()
+		dataSetId : function()
+		{
+			return jQuery( "#dataSetId" ).val();
+		}
 	} );
+
 	checkValueIsExist( "shortName", "validateDataSet.action", {
-		dataSetId : jQuery( "#dataSetId" ).val()
+		dataSetId : function()
+		{
+			return jQuery( "#dataSetId" ).val();
+		}
 	} );
+
 	checkValueIsExist( "code", "validateDataSet.action", {
-		dataSetId : jQuery( "#dataSetId" ).val()
+		dataSetId : function()
+		{
+			return jQuery( "#dataSetId" ).val();
+		}
 	} );
-
 } );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editSection.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editSection.js	2011-03-17 12:08:11 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/editSection.js	2011-03-18 12:12:14 +0000
@@ -23,8 +23,17 @@
 	jQuery( "#sectionName" ).attr( "maxlength", r.section.name.length[1] );
 
 	checkValueIsExist( "sectionName", "validateSection.action", {
-		dataSetId : jQuery( "#dataSetId" ).val(),
-		name : jQuery( "#sectionName" ).val(),
-		sectionId : jQuery( "#sectionId" ).val()
+		dataSetId : function()
+		{
+			return jQuery( "#dataSetId" ).val();
+		},
+		name : function()
+		{
+			return jQuery( "#sectionName" ).val();
+		},
+		sectionId : function()
+		{
+			return jQuery( "#sectionId" ).val();
+		}
 	} );
 } );