← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1643: lists should now load with values in IE

 

------------------------------------------------------------
revno: 1643
fixes bug(s): https://launchpad.net/bugs/418065
committer: Saptarshi <sunbiz@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-03-12 15:29:20 +0100
message:
  lists should now load with values in IE
modified:
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/multiDataSet.js
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.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-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js	2009-12-16 03:37:57 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/individual.js	2010-03-12 14:29:20 +0000
@@ -121,8 +121,8 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'availableDataElements' );
-    
+    var id;
+
     for ( id in availableAllDataElements )
     {
 		var option = new Option( availableAllDataElements[id], id );
@@ -130,8 +130,7 @@
 		option.onmousemove  = function(e){
 			showToolTip(e, this.text);
 		}
-		
-        list.add(option , null );
+		$("#availableDataElements").append( option ) ;
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js	2010-02-04 08:29:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataDictionary.js	2010-03-12 14:29:20 +0000
@@ -167,32 +167,24 @@
 {
     var id;
 
-    var list = document.getElementById( 'selectedDataElements' );
-    
     for ( id in selectedDataElements )
     {
-        list.add( new Option( selectedDataElements[id], id ), null );
+        $("#selectedDataElements").append( $( "<option></option>" ).attr( "value",id ).text( selectedDataElements[id] )) ;
     }
 
-    list = document.getElementById( 'availableDataElements' );
-
     for ( id in availableDataElements )
     {
-        list.add( new Option( availableDataElements[id], id ), null );
-    }    
-    
-    list = document.getElementById( 'selectedIndicators' );
-    
+        $("#availableDataElements").append( $( "<option></option>" ).attr( "value",id ).text( availableDataElements[id] )) ;
+    }
+
     for ( id in selectedIndicators )
     {
-        list.add( new Option( selectedIndicators[id], id ), null );
+        $("#selectedIndicators").append( $( "<option></option>" ).attr( "value",id ).text( selectedIndicators[id] )) ;
     }
 
-    list = document.getElementById( 'availableIndicators' );
-
     for ( id in availableIndicators )
     {
-        list.add( new Option( availableIndicators[id], id ), null );
+        $("#availableIndicators").append( $( "<option></option>" ).attr( "value",id ).text( availableIndicators[id] )) ;
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js	2010-03-10 06:35:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroup.js	2010-03-12 14:29:20 +0000
@@ -25,7 +25,7 @@
 
 function removeDataElementGroup( dataElementGroupId, dataElementGroupName )
 {
-	removeItem( dataElementGroupId, dataElementGroupName, i18n_confirm_delete, "removeDataElementGroup.action" );
+    removeItem( dataElementGroupId, dataElementGroupName, i18n_confirm_delete, "removeDataElementGroup.action" );
 }
 
 // -----------------------------------------------------------------------------
@@ -111,19 +111,15 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'groupMembers' );
     var id;
 
     for ( id in groupMembers )
     {
-        list.add( new Option( groupMembers[id], id ), null );
+        $("#groupMembers").append( $( "<option></option>" ).attr( "value",id ).text( groupMember[id] )) ;
     }
 
-    list = document.getElementById( 'availableDataElements' );
-
     for ( id in availableDataElements )
     {
-        list.add( new Option( availableDataElements[id], id ), null );
+        $("#availableDataElements").append( $( "<option></option>" ).attr( "value",id ).text( availableDataElements[id] )) ;
     }
 }
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js	2010-02-17 13:38:15 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElementGroupSet.js	2010-03-12 14:29:20 +0000
@@ -4,22 +4,22 @@
 
 function validateUpdateDataElementGroupSet(){
 
-	var request = new Request();
+    var request = new Request();
     request.setResponseTypeXML( 'message' );
     request.setCallbackSuccess( validateUpdateDataElementGroupSetCompleted );
-	request.sendAsPost( "id=" + getFieldValue("id") + "&name=" +  getFieldValue("name"));
-	request.send( "validateDataElementGroupSet.action");    
+    request.sendAsPost( "id=" + getFieldValue("id") + "&name=" +  getFieldValue("name"));
+    request.send( "validateDataElementGroupSet.action");
 	
 }
 
 function validateUpdateDataElementGroupSetCompleted( message ){
-	var type = message.getAttribute("type");
-	if(type=="success"){
-		selectAllById("groupMembers");
-		document.forms['updateDataElementGroupSet'].submit();
-	}else{
-		setMessage(message.firstChild.nodeValue);
-	}
+    var type = message.getAttribute("type");
+    if(type=="success"){
+        selectAllById("groupMembers");
+        document.forms['updateDataElementGroupSet'].submit();
+    }else{
+        setMessage(message.firstChild.nodeValue);
+    }
 }
 
 // -----------------------------------------------------------------------------
@@ -28,26 +28,26 @@
 
 function validateAddDataElementGroupSet()
 {	
-	var request = new Request();
+    var request = new Request();
     request.setResponseTypeXML( 'message' );
     request.setCallbackSuccess( validateAddDataElementGroupSetCompleted );    
-	request.sendAsPost( "name=" +  getFieldValue( "name" ) );
-	request.send( "validateDataElementGroupSet.action");	
+    request.sendAsPost( "name=" +  getFieldValue( "name" ) );
+    request.send( "validateDataElementGroupSet.action");
 }
 
 function validateAddDataElementGroupSetCompleted( message )
 {
-	var type = message.getAttribute("type");
+    var type = message.getAttribute("type");
 	
-	if( type == "success" )
-	{
-		selectAllById( "groupMembers" );
-		document.forms[ 'addDataElementGroupSet' ].submit();
-	}
-	else
-	{
-		setMessage(message.firstChild.nodeValue);
-	}
+    if( type == "success" )
+    {
+        selectAllById( "groupMembers" );
+        document.forms[ 'addDataElementGroupSet' ].submit();
+    }
+    else
+    {
+        setMessage(message.firstChild.nodeValue);
+    }
 }
 
 // -----------------------------------------------------------------------------
@@ -56,7 +56,7 @@
 
 function deleteDataElementGroupSet( groupSetId, groupSetName ){
 	
-	removeItem( groupSetId, groupSetName, i18n_confirm_delete, "deleteDataElementGroupSet.action" );
+    removeItem( groupSetId, groupSetName, i18n_confirm_delete, "deleteDataElementGroupSet.action" );
 }
 
 // -----------------------------------------------------------------------------
@@ -65,7 +65,7 @@
 
 function showDataElementGroupSetDetails( id ){
 
-	var request = new Request();
+    var request = new Request();
     request.setResponseTypeXML( 'dataElementGroupSet' );
     request.setCallbackSuccess( showDetailsCompleted );
     request.send( "showDataElementGroupSetDetails.action?id=" + id);	
@@ -74,7 +74,7 @@
 
 function showDetailsCompleted( dataElementGroupSet ){
 
-	setFieldValue( 'nameField', getElementValue( dataElementGroupSet, 'name' ) );
+    setFieldValue( 'nameField', getElementValue( dataElementGroupSet, 'name' ) );
     setFieldValue( 'memberCountField', getElementValue( dataElementGroupSet, 'memberCount' ) );
 
     showDetails();
@@ -86,19 +86,16 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'groupMembers' );
     var id;
 
     for ( id in groupMembers )
     {
-        list.add( new Option( groupMembers[id], id ), null );
+        $("#groupMembers").append( $( "<option></option>" ).attr( "value",id ).text( groupMembers[id] )) ;
     }
 
-    list = document.getElementById( 'availableDataElementGroups' );
-
     for ( id in availableDataElementGroups )
     {
-        list.add( new Option( availableDataElementGroups[id], id ), null );
+        $("#availableDataElementGroups").append( $( "<option></option>" ).attr( "value",id ).text( availableDataElementGroups[id] )) ;
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js	2010-02-04 08:29:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroup.js	2010-03-12 14:29:20 +0000
@@ -123,19 +123,16 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'groupMembers' );
     var id;
 
     for ( id in groupMembers )
     {
-        list.add( new Option( groupMembers[id], id ), null );
+        $("#groupMembers").append( $( "<option></option>" ).attr( "value",id ).text( groupMembers[id] )) ;
     }
 
-    list = document.getElementById( 'availableIndicators' );
-
     for ( id in availableIndicators )
     {
-        list.add( new Option( availableIndicators[id], id ), null );
+        $("#availableIndicators").append( $( "<option></option>" ).attr( "value",id ).text( availableIndicators[id] )) ;
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js	2010-02-10 17:00:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/indicatorGroupSet.js	2010-03-12 14:29:20 +0000
@@ -82,19 +82,16 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'groupMembers' );
     var id;
 
     for ( id in groupMembers )
     {
-        list.add( new Option( groupMembers[id], id ), null );
+        $("#groupMembers").append( $( "<option></option>" ).attr( "value",id ).text( groupMembers[id] )) ;
     }
 
-    list = document.getElementById( 'availableIndicatorGroups' );
-
     for ( id in availableIndicatorGroups )
     {
-        list.add( new Option( availableIndicatorGroups[id], id ), null );
+        $("#availableIndicatorGroups").append( $( "<option></option>" ).attr( "value",id ).text( availableIndicatorGroups[id] )) ;
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js	2010-03-10 06:35:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js	2010-03-12 14:29:20 +0000
@@ -185,17 +185,13 @@
 {
     var id;
 	
-	var list = document.getElementById( 'selectedList' );
-	
     for ( id in dataSetMembers )
     {
-        list.add( new Option( dataSetMembers[id], id ), null );
-    }	
-	
-    list = document.getElementById( 'availableList' );
-    
+        $("#selectedList").append( $( "<option></option>" ).attr( "value",id ).text( dataSetMembers[id] )) ;
+    }
+		
     for ( id in availableDataElements )
     {
-        list.add( new Option( availableDataElements[id], id ), null );
+        $("#availableList").append( $( "<option></option>" ).attr( "value",id ).text( availableDataElements[id] )) ;
     }
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/multiDataSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/multiDataSet.js	2010-03-10 06:35:04 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/multiDataSet.js	2010-03-12 14:29:20 +0000
@@ -6,18 +6,14 @@
 function initLists()
 {
     var id;
-	
-	var list = document.getElementById( 'selectedDataSets' );
-	
-    for ( id in selectedDataSets )
+
+	for ( id in selectedDataSets )
     {
-        list.add( new Option( selectedDataSets[id], id ), null );
-    }	
-	
-    list = document.getElementById( 'availableDataSets' );
-    
+        $("#selectedDataSets").append( $( "<option></option>" ).attr( "value",id ).text( selectedDataSets[id] )) ;
+    }
+
     for ( id in availableDataSets )
     {
-        list.add( new Option( availableDataSets[id], id ), null );
+        $("#availableDataSets").append( $( "<option></option>" ).attr( "value",id ).text( availableDataSets[id] )) ;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js	2010-02-10 19:12:22 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js	2010-03-12 14:29:20 +0000
@@ -130,19 +130,15 @@
 
 function initLists()
 {
-    var list = document.getElementById( 'groupMembers' );
     var id;
-
     for ( id in groupMembers )
     {
-        list.add( new Option( groupMembers[id], id ), null );
+        $("#groupMembers").append( $( "<option></option>" ).attr( "value",id ).text( groupMembers[id] )) ;
     }
 
-    list = document.getElementById( 'availableValidationRules' );
-
     for ( id in availableValidationRules )
     {
-        list.add( new Option( availableValidationRules[id], id ), null );
+        $("#availableValidationRules").append( $( "<option></option>" ).attr( "value",id ).text( availableValidationRules[id] )) ;
     }
 }