=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js 2011-08-09 08:50:30 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js 2011-08-10 07:45:21 +0000 @@ -63,7 +63,7 @@ localStorage[getTagId( "Roots" )] = JSON.stringify( roots ); - if ( sessionStorage[getTagId( "Selected" )] === undefined ) + if ( sessionStorage[getTagId( "Selected" )] == null ) { if ( multipleSelectionAllowed ) { @@ -80,7 +80,7 @@ subtree.reloadTree(); } - selection.sync(); + //selection.sync(); $( "#ouwt_loader" ).hide(); } ); @@ -89,7 +89,7 @@ // server = true : sync from server // server = false : sync to server this.sync = function( server ) - { + { if ( server ) { sessionStorage.removeItem( getTagId( "Selected" ) ); @@ -124,13 +124,13 @@ { $.post( organisationUnitTreePath + "clearselected.action", function() { - if ( sessionStorage[getTagId( "Selected" )] === undefined ) + if ( sessionStorage[getTagId( "Selected" )] == null ) { return; } var selected = JSON.parse( sessionStorage[getTagId( "Selected" )] ); - + if ( multipleSelectionAllowed ) { if ( !$.isArray( selected ) ) @@ -152,11 +152,12 @@ selected = selected[0]; } - $.post( organisationUnitTreePath + "setorgunit.action", { - id : selected - } ); - } - } ); + $.post( organisationUnitTreePath + "setorgunit.action", { + id : selected + },this.responseReceived ); + } + }); + } } @@ -398,7 +399,7 @@ expandTreeAtOrgUnit = function( ou ) { - if ( localStorage[getTagId( ou )] === undefined ) + if ( localStorage[getTagId( ou )] == null ) { return; } @@ -455,7 +456,7 @@ var $treeTag = $( "#orgUnitTree" ); $treeTag.children().eq( 0 ).remove(); - if ( sessionStorage[getTagId( "Selected" )] === undefined ) + if ( sessionStorage[getTagId( "Selected" )] == null ) { var roots = JSON.parse( localStorage[getTagId( "Roots" )] );