=== 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-15 12:44:50 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2011-08-15 13:48:42 +0000 @@ -215,15 +215,15 @@ for(var dataValueKey in dataValues) { var dataValue = dataValues[dataValueKey]; - console.log(dataValue); $.ajax( { url : "saveValue.action", data : dataValue, dataType : 'json', - success : function( json ) { - storageManager.clearDataValueJSON( dataValue ); - console.log("Successfully saved dataValue with value " + dataValue.value); + dataValue: dataValue, + success : function( data, textStatus, jqXHR ) { + storageManager.clearDataValueJSON( this.dataValue ); + console.log("Successfully saved dataValue with value " + this.dataValue ); } } ); } === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-08-15 12:44:50 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-08-15 13:48:42 +0000 @@ -1079,9 +1079,14 @@ var id = this.getDataValueIdentifier( dataElementId, categoryOptionComboId, periodId, organisationUnitId ); var dataValues = this.getAllDataValues(); - console.log("deleting with id " + id); + var ret = delete dataValues[id]; - delete dataValues[id]; + if(ret) { + console.log("deleted with id " + id); + } else { + console.log("could not delete with id " + id); + } + localStorage[KEY_DATAVALUES] = JSON.stringify( dataValues ); }