← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 585: Improved user feedback for custom values.

 

------------------------------------------------------------
revno: 585
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Sat 2009-09-05 09:23:38 +0200
message:
  Improved user feedback for custom values.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm


--
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/editCustomValues.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 07:10:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm	2009-09-05 07:23:38 +0000
@@ -358,15 +358,14 @@
     dataElementSelector.add( option, null );
   }
   
-  var messageContainer = document.getElementById('message');
   if( dataElementList.length <=0 )
   {
-    messageContainer.innerHTML = "$i18n.getString( "no_more_elements_to_select" )";     
+    setMessage( "No more elements to select" ); //?  
 //    window.parent.SetOkButton( false ) ;
   }
   else
   {
-    messageContainer.innerHTML = " ";   
+    hideMessage();
 //    window.parent.SetOkButton( true ) ;
   }
 }
@@ -422,12 +421,12 @@
   var messageContainer = document.getElementById('message');
   if( (optionsList.length ==1 &&  optionsList[0]=="NULL") || (optionsList.length ==0) )
   {
-    messageContainer.innerHTML = "$i18n.getString( "no_more_categories_to_select" )";   
+    setMessage( "No more categories to select" ); //?   
     //window.parent.SetOkButton( false ) ;
   }
   else
   {
-    messageContainer.innerHTML = " ";   
+    hideMessage();  
 //    window.parent.SetOkButton( true ) ;
   }
 }
@@ -455,18 +454,16 @@
         
     customValueSelector.add( option, null );
   }
-  
-  var messageContainer = document.getElementById('message');
-  
+    
   //here add if single value dissable and make the only element selected
   
   if( (custom_ValueList.length ==1 &&  custom_ValueList[0]=="NULL") || (custom_ValueList.length ==0) )
   {
-    messageContainer.innerHTML = "$i18n.getString( "no_more_categories_to_select" )";   
+    setMessage( "No more categories to select" ); //?   
   }
   else
   {
-    messageContainer.innerHTML = " ";   
+    hideMessage();  
   }
 }
 
@@ -533,18 +530,16 @@
         
     availableCustomValue.add( option, null );
   }
-  
-  var messageContainer = document.getElementById('message');
-  
+    
   //here add if single value dissable and make the only element selected
   
   if( (custom_ValueList.length ==1 &&  custom_ValueList[0]=="NULL") || (custom_ValueList.length ==0) )
   {
-    messageContainer.innerHTML = " ";   
+    hideMessage();
   }
   else
   {
-    messageContainer.innerHTML = " ";   
+    hideMessage();   
   }
 }
 
@@ -596,11 +591,11 @@
 {
   if (document.getElementById( 'optionComboSelector' ).selectedIndex==-1 || document.getElementById( 'dataElementSelector' )==-1) 
   {
-    alert("\nYou must make a selection from the DataElement and ComboOptions panels first.");
+    setMessage("You must make a selection from the Data element and Combo options panels first");
   }
   else if(document.getElementById( 'newCustomValue' ).value=='')
   {
-    alert("\nCustom Value Must be added and should be unique" );
+    setMessage("Custom value must be entered" );
   }
   else
   {
@@ -618,7 +613,7 @@
     
     if(isDuplicate=='true')
     {
-      alert("\nDude, Duplicates are not allowed");
+      setMessage("Duplicates are not allowed");
     }
     else
     {
@@ -631,15 +626,15 @@
 {
   if (document.getElementById( 'dataElementSelector' )==-1) 
   {
-    alert("\nYou must make a selection from the DataElement panel first.");
+    setMessage("You must make a selection from the data element panel first");
   }
   else if (document.getElementById( 'optionComboSelector' ).selectedIndex==-1) 
   {
-    alert("\nYou must make a selection from the ComboOptions panel first.");
+    setMessage("You must make a selection from the Combo options panel first");
   }
   else if (document.getElementById( 'customValueSelector' ).selectedIndex==-1) 
   {
-    alert("\nYou must make a selection from the CustomValues panel first.");
+    setMessage("You must make a selection from the Custom values panel first");
   }
   else
   {
@@ -750,5 +745,5 @@
 </tbody>
 </table>                                  
 
-<div id="message" name="message">&nbsp;</div>
+<span id="message"></span>
 <input type="hidden" name="dataSetIdField" id="dataSetIdField" value="$dataSet.id">