← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4191: All event handling / javascript method calls applied to the dataentry forms in javascript

 

Merge authors:
  Lars Helge Øverland (larshelge)
------------------------------------------------------------
revno: 4191 [merge]
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-21 22:52:10 +0200
message:
  All event handling / javascript method calls applied to the dataentry forms in javascript
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm
  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/sectionForm.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2011-04-24 15:50:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java	2011-07-21 20:33:57 +0000
@@ -242,6 +242,13 @@
      * @return all DataElements which are not assigned to any DataSets.
      */
     Collection<DataElement> getDataElementsWithoutDataSets();
+
+    /**
+     * Returns all DataElements which are assigned to at least one DataSet.
+     * 
+     * @return all DataElements which are assigned to at least one DataSet.
+     */
+    Collection<DataElement> getDataElementsWithDataSets();
     
     /**
      * Checks whether a DataElement with the given identifier exists.

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java	2011-04-24 15:50:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementStore.java	2011-07-21 20:33:57 +0000
@@ -219,6 +219,13 @@
     Collection<DataElement> getDataElementsWithoutDataSets();
     
     /**
+     * Returns all DataElements which are assigned to at least one DataSet.
+     * 
+     * @return all DataElements which are assigned to at least one DataSet.
+     */
+    Collection<DataElement> getDataElementsWithDataSets();
+    
+    /**
      * Checks whether a DataElement with the given identifier exists.
      * 
      * @param id the DataElement identifier.

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2011-04-24 15:50:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java	2011-07-21 20:33:57 +0000
@@ -302,6 +302,11 @@
     {
         return i18n( i18nService, dataElementStore.getDataElementsWithoutDataSets() );
     }
+    
+    public Collection<DataElement> getDataElementsWithDataSets()
+    {
+        return i18n( i18nService, dataElementStore.getDataElementsWithDataSets() );
+    }
 
     public boolean dataElementExists( int id )
     {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2011-06-07 05:46:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java	2011-07-21 20:33:57 +0000
@@ -308,6 +308,14 @@
         return sessionFactory.getCurrentSession().createQuery( hql ).list();
     }
 
+    @SuppressWarnings( "unchecked" )
+    public Collection<DataElement> getDataElementsWithDataSets()
+    {
+        String hql = "from DataElement d where d.dataSets.size > 0";
+
+        return sessionFactory.getCurrentSession().createQuery( hql ).list();
+    }
+
     public boolean dataElementExists( int id )
     {
         final String sql = "select count(*) from dataelement where dataelementid=" + id;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2011-07-21 18:20:49 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java	2011-07-21 20:11:07 +0000
@@ -28,7 +28,6 @@
  */
 
 import static org.hisp.dhis.dataelement.DataElement.VALUE_TYPE_BOOL;
-import static org.hisp.dhis.dataelement.DataElement.VALUE_TYPE_INT;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -234,10 +233,8 @@
         
         int i = 1;
         
-        final String jsCodeForInputFields = " name=\"entryfield\" $DISABLED onchange=\"saveVal( $DATAELEMENTID, $OPTIONCOMBOID )\" style=\"text-align:center\" onkeyup=\"return keyPress(event, this)\" ";
-        final String jsCodeForSelectLists = " name=\"entryfield\" $DISABLED onchange=\"saveBoolean( $DATAELEMENTID, $OPTIONCOMBOID )\" onkeyup=\"keyPress(event, this)\" ";
-        
-        final String historyCode = " ondblclick='javascript:viewHist( $DATAELEMENTID, $OPTIONCOMBOID )' ";
+        final String jsCodeForInputFields = " name=\"entryfield\" $DISABLED ";
+        final String jsCodeForSelectLists = " name=\"entryfield\" $DISABLED ";
         
         StringBuffer sb = new StringBuffer();
 
@@ -310,22 +307,11 @@
                 }
                 else
                 {
-                    appendCode += jsCodeForInputFields + "tabindex=\"" + i++ + "\"";
-
-                    if ( dataElement.getType().equals( VALUE_TYPE_INT ) )
-                    {
-                        appendCode += historyCode;
-                    }
-
-                    appendCode += TAG_CLOSE;
+                    appendCode += jsCodeForInputFields + "tabindex=\"" + i++ + "\"" + TAG_CLOSE;
                 }
 
                 inputHtml = inputHtml.replace( TAG_CLOSE, appendCode );
                 
-                inputHtml = inputHtml.replace( "$DATAELEMENTID", String.valueOf( dataElementId ) );
-                inputHtml = inputHtml.replace( "$DATAELEMENTNAME", dataElement.getName() );
-                inputHtml = inputHtml.replace( "$DATAELEMENTTYPE", dataElementValueType );
-                inputHtml = inputHtml.replace( "$OPTIONCOMBOID", String.valueOf( optionComboId ) );
                 inputHtml = inputHtml.replace( "$DISABLED", disabled );
                 inputHtml = inputHtml.replace( STYLE_TAG, backgroundColor );
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2011-06-10 16:26:06 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2011-07-21 20:49:52 +0000
@@ -281,6 +281,8 @@
   background-color: #ffffbf;
   border: 1px solid #cccc00;
   width: 500px;
+  border-radius: 3px;
+  -moz-border-radius: 3px; /* Firefox */
 }
 
 span#info
@@ -291,6 +293,8 @@
   background-color: #baffbc;
   border: 1px solid #12cd17;
   width: 500px;
+  border-radius: 3px;
+  -moz-border-radius: 3px; /* Firefox */
 }
 
 div#detailsArea 
@@ -323,17 +327,17 @@
   left: 180px;
   position: fixed;
   display: none;
-  height: 26px;
+  height: 30px;
   width: 380px;
   background-color: #ffffbf;
-  border-right: 1px solid #cccc00;
-  border-bottom: 1px solid #cccc00;
-  border-left: 1px solid #cccc00;
+  border: 1px solid #cccc00;
   z-index: 21;
   font-size: 9pt;
   text-align: center;
   vertical-align: center;
-  line-height: 25px;
+  line-height: 30px;
+  border-radius: 3px;
+  -moz-border-radius: 3px; /* Firefox */
 }
 
 /*----------------------------------------------------------------------------*/

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-06-19 11:30:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2011-07-21 20:49:52 +0000
@@ -578,7 +578,7 @@
  */
 function hideHeaderMessage()
 {
-    $( 'div#headerMessage' ).slideUp( 'slow' );
+    $( 'div#headerMessage' ).slideUp( 'fast' );
 }   
 
 /**

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java	2011-07-21 17:38:11 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/PageInitAction.java	2011-07-21 20:33:57 +0000
@@ -127,7 +127,7 @@
         
         significantZeros = dataElementService.getDataElementsByZeroIsSignificant( true );
         
-        dataElements = dataElementService.getAllDataElements(); //TODO with data sets only
+        dataElements = dataElementService.getDataElementsWithDataSets();
         
         indicators = indicatorService.getIndicatorsWithDataSets();
         

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm	2011-07-21 18:20:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm	2011-07-21 20:27:34 +0000
@@ -10,13 +10,13 @@
   #set( $categoryOptions = $optionsMap.get( $category.id ) )
   #set( $colCount = $colCount / $categoryOptions.size() )
   <tr colspan="$colCount">
-    <td></td>
-    #set( $cols = $colRepeat.get( $category.id ) )
-    #foreach( $col in $cols )
-      #foreach( $categoryOption in $categoryOptions )
-      <th colspan="$colCount"><div align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</div></th>
-      #end
-    #end
+  <td></td>
+  #set( $cols = $colRepeat.get( $category.id ) )
+  #foreach( $col in $cols )
+  #foreach( $categoryOption in $categoryOptions )
+  <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</span></th>
+  #end
+  #end
   </tr>
   #end
 
@@ -34,22 +34,22 @@
   #end
   #set( $count = $count + 1 )
   <tr>
-    <td  style="#if( $mark == 1 )background-color:#e0e0e0;#end padding-right:50px;"><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
-    #foreach( $optionCombo in $optionCombos )
-	#set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )	    
-	<td>
-	#if( $dataElement.type == "bool" )
-	<select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" ) ) onchange="saveBoolean($dataElement.id,$optionCombo.id )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-      <option value="">[$i18n.getString( "no_value" )]</option>
-      <option value="true">$i18n.getString( "yes" )</option>
-      <option value="false">$i18n.getString( "no" )</option>
-    </select>
-	#else
-	<input name="entryfield" id="$dataEntryId" type="text" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveVal(${dataElement.id},${optionCombo.id})" ondblclick="viewHist(${dataElement.id},${optionCombo.id})" #else disabled="disabled"#end onkeyup="keyPress(event,this)" class="entryField" tabindex="$tabIndex" #if( $locked )disabled="disabled"#end>
-	#end
-	</td>
-	#set( $tabIndex = $tabIndex + 1 )
-    #end
+  <td #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
+  #foreach( $optionCombo in $optionCombos )
+  #set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )	    
+  <td>
+  #if( $dataElement.type == "bool" )
+  <select name="entryselect" id="$dataEntryId" #if( !$auth.hasAccess( "dhis-web-dataentry", "saveValue" ) )disabled="disabled"#end tabindex="$tabIndex" #if( $locked )disabled="disabled"#end>
+    <option value="">[$i18n.getString( "no_value" )]</option>
+    <option value="true">$i18n.getString( "yes" )</option>
+    <option value="false">$i18n.getString( "no" )</option>
+  </select>
+  #else
+  <input name="entryfield" id="$dataEntryId" type="text" #if( !$auth.hasAccess( "dhis-web-dataentry", "saveValue") )disabled="disabled"#end tabindex="$tabIndex" #if( $locked )disabled="disabled"#end>
+  #end
+  </td>
+  #set( $tabIndex = $tabIndex + 1 )
+  #end
   </tr>
   #end
 </table>

=== 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-07-21 18:20:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-07-21 20:11:07 +0000
@@ -1,4 +1,4 @@
-// Identifiers for which zero values are, insignificant, also used in entry.js, populated in select.vm
+// Identifiers for which zero values are insignificant, also used in entry.js, populated in select.vm
 var significantZeros = [];
 
 // Array with associative arrays for each data element, populated in select.vm
@@ -36,8 +36,44 @@
 
 function addEventListeners()
 {
-    $( '[name="entryfield"]' ).focus( valueFocus );
-    $( '[name="entryselect"]' ).focus( valueFocus );
+    $( '[name="entryfield"]' ).each( function( i ) 
+    {
+    	var id = $( this ).attr( 'id' );    	
+		var dataElementId = id.split( '-' )[0];
+		var optionComboId = id.split( '-' )[1];	
+    	
+    	$( this ).focus( valueFocus );
+    	
+    	$( this ).change( function() {
+    		saveVal( dataElementId, optionComboId );
+    	} );
+    	
+    	$( this ).dblclick( function() {
+    		viewHist( dataElementId, optionComboId );
+    	} );
+    	
+    	$( this ).keyup( function() {
+    		keyPress( event, this );
+    	} );
+    	
+    	$( this ).css( 'width', '100%' );
+    	$( this ).css( 'text-align', 'center' );
+    } );
+    
+    $( '[name="entryselect"]' ).each( function( i )
+    {
+    	var id = $( this ).attr( 'id' );    	
+		var dataElementId = id.split( '-' )[0];
+		var optionComboId = id.split( '-' )[1];	
+		
+    	$( this ).focus( valueFocus );
+    	
+    	$( this ).change( function() {
+    		saveBoolean( dataElementId, optionComboId );
+    	} );
+    	
+    	$( this ).css( 'width', '100%' );
+    } );
 }
 
 function clearPeriod()
@@ -300,6 +336,7 @@
 function displayEntryFormCompleted()
 {
     addEventListeners();
+    
     $( '#validationButton' ).removeAttr( 'disabled' );
     $( '#defaultForm' ).removeAttr( 'disabled' );
     

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2011-07-21 18:20:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2011-07-21 20:27:34 +0000
@@ -12,66 +12,65 @@
 <table style="border:1px solid #c0c0c0; padding:10px;">
 <tr>
   <td>
-    <div style="text-align:center"><h3>$encoder.htmlEncode( $section.name )</h3></div>
+    <div class="cent"><h3>$encoder.htmlEncode( $section.name )</h3></div>
   </td>
 </tr>
 <tr>
   <td>
-    <div id="$section.id" style="display:block">
-      <table cellpadding="0">
-      #set( $categoryComboId = $sectionCombos.get( $section.id ) )
-      #set( $colCount = $numberOfTotalColumns.get( $categoryComboId ) )
-      #set( $categories = $orderedCategories.get( $categoryComboId ) )
-      #set( $optionsMap = $orderedOptionsMap.get( $categoryComboId ) )
-      #set( $colRepeat = $catColRepeat.get( $categoryComboId ) )
+    <div>
+    <table cellpadding="0">
+    #set( $categoryComboId = $sectionCombos.get( $section.id ) )
+    #set( $colCount = $numberOfTotalColumns.get( $categoryComboId ) )
+    #set( $categories = $orderedCategories.get( $categoryComboId ) )
+    #set( $optionsMap = $orderedOptionsMap.get( $categoryComboId ) )
+    #set( $colRepeat = $catColRepeat.get( $categoryComboId ) )
 	
-      #foreach( $category in $categories )
-	  #set( $categoryOptions = $optionsMap.get( $category.id ) )
-      #set( $colCount = $colCount / $categoryOptions.size() )
-      <tr colspan="$colCount">
-      <td></td>
-        #set( $cols = $colRepeat.get( $category.id ) )
-        #foreach( $col in $cols )
-        #foreach( $categoryOption in $categoryOptions )
-        <th colspan="$colCount"><div align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</div></th>
-        #end
-        #end
-      </tr>
-      #end
+    #foreach( $category in $categories )
+    #set( $categoryOptions = $optionsMap.get( $category.id ) )
+    #set( $colCount = $colCount / $categoryOptions.size() )
+    <tr colspan="$colCount">
+    <td></td>
+    #set( $cols = $colRepeat.get( $category.id ) )
+    #foreach( $col in $cols )
+    #foreach( $categoryOption in $categoryOptions )
+    <th colspan="$colCount"><span align="center">#if( $categoryOption.isDefault() )${i18n.getString( "value" )}#else ${encoder.htmlEncode( $categoryOption.name )}#end</span></th>
+    #end
+    #end
+    </tr>
+    #end
 
-      #set( $count = 0 )
-      #set( $mark = 0 )
-      #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryComboId )  )
-      #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.id}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.name )}</span>
-      #end
-      #foreach( $dataElement in $section.dataElements )
-      #if( $mark == 1 )
-      #set( $mark = 0 )
-      #else
-      #set( $mark = 1 )
-      #end
-      #set( $count = $count + 1 )
-      <tr>
-        <td  style="#if( $mark == 1 )background-color:#e0e0e0;#end padding-right:50px;"><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
-        #foreach( $optionCombo in $optionCombos )
-        #set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )
-        #set( $greyedField = false )
-        #set( $greyedField = $greyedFields.get( "$dataElement.id:$optionCombo.id" ) )        
-        <td>
-        #if( $dataElement.type == "bool" )
-        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" ) ) onchange="saveBoolean($dataElement.id,$optionCombo.id )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end #if( $greyedField ) disabled="disabled"#end>
-	      <option value="">[$i18n.getString( "no_value" )]</option>
-          <option value="true">$i18n.getString( "yes" )</option>
-          <option value="false">$i18n.getString( "no" )</option>
-        </select>
-        #else
-        <input name="entryfield" id="$dataEntryId" type="text" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveVal(${dataElement.id},${optionCombo.id})" ondblclick="viewHist(${dataElement.id},${optionCombo.id})" #else disabled="disabled"#end onkeyup="keyPress(event,this)" class="entryField#if( $locked || $greyedField ) grey#end" tabindex="$tabIndex" #if( $locked || $greyedField )disabled="disabled"#end>
-        #end
-      </td>
-      #set( $tabIndex = $tabIndex + 1 )
-      #end
-      </tr>
-	#end
+    #set( $count = 0 )
+    #set( $mark = 0 )
+    #set( $optionCombos = $orderdCategoryOptionCombos.get( $categoryComboId )  )
+    #foreach( $optionCombo in $optionCombos )<span id="${optionCombo.id}-optioncombo" class="hidden">${encoder.htmlEncode( $optionCombo.name )}</span>
+    #end
+    #foreach( $dataElement in $section.dataElements )
+    #if( $mark == 1 )
+    #set( $mark = 0 )
+    #else
+    #set( $mark = 1 )
+    #end
+    #set( $count = $count + 1 )
+    <tr>
+    <td #if( $mark == 1 )class="altRow"#else class="regRow"#end><span>${encoder.htmlEncode( $dataElement.name )}</span></td>
+    #foreach( $optionCombo in $optionCombos )
+    #set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" )
+    #set( $greyedField = false )
+    #set( $greyedField = $greyedFields.get( "$dataElement.id:$optionCombo.id" ) )        
+    #if( $dataElement.type == "bool" )
+    <td><select name="entryselect" id="$dataEntryId" #if( !$auth.hasAccess( "dhis-web-dataentry", "saveValue" ) )disabled="disabled"#end tabindex="$tabIndex" #if( $locked || $greyedField )disabled="disabled"#end>
+      <option value="">[$i18n.getString( "no_value" )]</option>
+      <option value="true">$i18n.getString( "yes" )</option>
+      <option value="false">$i18n.getString( "no" )</option>
+    </select></td>
+    #else
+    <td><input name="entryfield" id="$dataEntryId" type="text" #if( !$auth.hasAccess( "dhis-web-dataentry", "saveValue" ) )disabled="disabled"#end tabindex="$tabIndex" #if( $locked || $greyedField )class="grey" disabled="disabled"#end></td>
+    #end
+    </td>
+    #set( $tabIndex = $tabIndex + 1 )
+    #end
+    </tr>
+    #end
 	</table>
     </div>
     </td>

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-07-21 18:20:49 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-07-21 19:49:23 +0000
@@ -28,8 +28,7 @@
 #set( $size2 = $dataElements.size() )
 #foreach( $dataElement in $dataElements )
 "${dataElement.id}": {
-"name":"${dataElement.name}",
-"type":"$encoder.jsonEncode( ${dataElement.getDetailedNumberType()} )"
+"name":"${dataElement.name}", "type":"$encoder.jsonEncode( ${dataElement.getDetailedNumberType()} )"
 }#if( $velocityCount < $size2 ),#end
 #end };
 
@@ -41,8 +40,7 @@
 #set( $size3 = $dataSets.size() )
 #foreach( $dataSet in $dataSets )
 "${dataSet.id}": {
-"name":"$encoder.jsonEncode( ${dataSet.name} )",
-"periodType":"$encoder.jsonEncode( ${dataSet.periodType.name} )" 
+"name":"$encoder.jsonEncode( ${dataSet.name} )", "periodType":"$encoder.jsonEncode( ${dataSet.periodType.name} )" 
 }#if( $velocityCount < $size3 ),#end
 #end };
 

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2011-07-12 15:59:42 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/style/dhis-web-dataentry.css	2011-07-21 20:27:34 +0000
@@ -28,12 +28,6 @@
   display: none;
 }
 
-.entryField
-{
-  width: 100%;
-  text-align: center;
-}
-
 .minmax
 {
   background-color: #ff6600;
@@ -44,6 +38,22 @@
   background-color: #cccccc;
 }
 
+.altRow
+{
+  background-color: #e0e0e0;
+  padding-right: 50px;
+}
+
+.regRow
+{
+  padding-right: 50px;
+}
+
+.cent
+{
+  text-align: center;
+}
+
 @media print 
 {
   #mainHeader, #topMenu, #leftBar, #currentSelection, #actions, input[type=button] 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2011-06-20 04:14:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2011-07-21 20:49:52 +0000
@@ -92,7 +92,7 @@
 			}
 			else if ( json.response == "error" )
 			{
-				alert( json.message );
+				setHeaderDelayMessage( json.message );
 			}
 		}
 	);