← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4493: Fixed bug in data entry, could not delete existing values

 

------------------------------------------------------------
revno: 4493
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-08-31 21:14:56 +0200
message:
  Fixed bug in data entry, could not delete existing values
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-08-25 12:32:42 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2011-08-31 19:14:56 +0000
@@ -85,7 +85,12 @@
 
     var periodId = $( '#selectedPeriodId' ).val();
 
-    if ( value )
+	if ( value == null )
+	{
+		value = '';
+	}
+
+    if ( value != '' )
     {
         if ( type == 'int' || type == 'number' || type == 'positiveNumber' || type == 'negativeNumber' )
         {
@@ -150,13 +155,13 @@
                 }
             }
         }
-
-        var valueSaver = new ValueSaver( dataElementId, optionComboId, 
-        	currentOrganisationUnitId, periodId, value, COLOR_GREEN );
-        valueSaver.save();
-
-        updateIndicators(); // Update indicators in case of custom form
     }
+
+    var valueSaver = new ValueSaver( dataElementId, optionComboId, 
+    	currentOrganisationUnitId, periodId, value, COLOR_GREEN );
+    valueSaver.save();
+
+    updateIndicators(); // Update indicators in case of custom form
 }
 
 function saveBoolean( dataElementId, optionComboId )