← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7477: local/in merge dataanalyser from 2.7 to trunk

 

------------------------------------------------------------
revno: 7477
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-02 13:09:05 +0530
message:
  local/in merge dataanalyser from 2.7 to trunk
added:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/GetDataElementGroupAction.java
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/getDataElementGrp.vm
modified:
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsAction.java
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java
  local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties
  local/in/dhis-web-dashboard/src/main/resources/struts.xml
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisDataElementFront.vm
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js
  local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm
  local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties


--
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 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsAction.java	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsAction.java	2012-07-02 07:39:05 +0000
@@ -37,10 +37,10 @@
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
-//import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
 
 import com.opensymphony.xwork2.Action;
 
@@ -70,14 +70,14 @@
     {
         this.dataElementCategoryService = dataElementCategoryService;
     }
-    
+
     private SectionService sectionService;
 
     public void setSectionService( SectionService sectionService )
     {
         this.sectionService = sectionService;
     }
-    
+
     // -------------------------------------------------------------------------
     // Comparator
     // -------------------------------------------------------------------------
@@ -92,13 +92,12 @@
     // DisplayPropertyHandler
     // -------------------------------------------------------------------------
     /*
-    private DisplayPropertyHandler displayPropertyHandler;
-
-    public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler )
-    {
-        this.displayPropertyHandler = displayPropertyHandler;
-    }
-    */
+     * private DisplayPropertyHandler displayPropertyHandler;
+     * 
+     * public void setDisplayPropertyHandler( DisplayPropertyHandler
+     * displayPropertyHandler ) { this.displayPropertyHandler =
+     * displayPropertyHandler; }
+     */
     // -------------------------------------------------------------------------
     // Input & output
     // -------------------------------------------------------------------------
@@ -142,6 +141,13 @@
         return optionComboIds;
     }
 
+    private String chkValue;
+
+    public void setChkValue( String chkValue )
+    {
+        this.chkValue = chkValue;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -150,52 +156,66 @@
     {
         optionComboIds = new ArrayList<String>();
         optionComboNames = new ArrayList<String>();
-        
-        System.out.println(" id = " +id );
+
+        System.out.println( " id = " + id );
         if ( id == null || id == 0 )
         {
             dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
-            System.out.println("id = "+id + " dataElements size = "+dataElements.size());
-        } 
+            System.out.println( "id = " + id + " dataElements size = " + dataElements.size() );
+        }
         else
         {
-            //DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( id );
-            Section section = sectionService.getSection( id );
-            /*
-            if ( dataElementGroup != null )
-            {
-                dataElements = new ArrayList<DataElement>( dataElementGroup.getMembers() );
-                System.out.println("dataElementGroup id = "+id + " dataElements size = "+dataElements.size());
-            }
-             */
-            if ( section != null )
-            {
-                dataElements = new ArrayList<DataElement>( section.getDataElements() );
-                System.out.println("section id = "+ id + " dataElements size = "+ dataElements.size());
-            }            
-            else
-            {
-                dataElements = new ArrayList<DataElement>();
-            }
+            if ( chkValue.equals( "true" ) )
+            {
+                DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( id );
+                if ( dataElementGroup != null )
+                {
+                    dataElements = new ArrayList<DataElement>( dataElementGroup.getMembers() );
+                    // System.out.println( "dataElementGroup id = " + id +
+                    // " dataElements size = " + dataElements.size() );
+                }
+                else
+                {
+                    dataElements = new ArrayList<DataElement>();
+                }
+            }
+            if ( chkValue.equals( "false" ) )
+            {
+                Section section = sectionService.getSection( id );
+                if ( section != null )
+                {
+                    dataElements = new ArrayList<DataElement>( section.getDataElements() );
+                    // System.out.println( "section id = " + id +
+                    // " dataElements size = " + dataElements.size() );
+                }
+                else
+                {
+                    dataElements = new ArrayList<DataElement>();
+                }
+            }
+
         }
-        System.out.println(" dataElements size = "+dataElements.size());
+
+        System.out.println( " dataElements size = " + dataElements.size() );
         Iterator<DataElement> alldeIterator = dataElements.iterator();
         while ( alldeIterator.hasNext() )
         {
-            
+
             DataElement de1 = alldeIterator.next();
-           // de1.getDomainType()
-            //if ( !de1.getType().equals( DataElement.VALUE_TYPE_INT ) || !de1.getType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
-            if ( !de1.getType().equals( DataElement.VALUE_TYPE_INT ) || !de1.getDomainType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )    
+            // de1.getDomainType()
+            // if ( !de1.getType().equals( DataElement.VALUE_TYPE_INT ) ||
+            // !de1.getType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
+            if ( !de1.getType().equals( DataElement.VALUE_TYPE_INT )
+                || !de1.getDomainType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
             {
-                
+
                 alldeIterator.remove();
             }
         }
-        System.out.println(" dataElements size = "+dataElements.size());
+        System.out.println( " dataElements size = " + dataElements.size() );
         Collections.sort( dataElements, dataElementComparator );
 
-        //displayPropertyHandler.handle( dataElements );
+        // displayPropertyHandler.handle( dataElements );
 
         if ( deOptionValue != null )
         {
@@ -215,7 +235,8 @@
                     {
                         DataElementCategoryOptionCombo decoc = optionComboIterator.next();
                         optionComboIds.add( de.getId() + ":" + decoc.getId() );
-                        optionComboNames.add( de.getName() + ":" + dataElementCategoryService.getDataElementCategoryOptionCombo( decoc ).getName() );
+                        optionComboNames.add( de.getName() + ":"
+                            + dataElementCategoryService.getDataElementCategoryOptionCombo( decoc ).getName() );
 
                     }
 
@@ -223,7 +244,6 @@
             }
         }
 
-
         return SUCCESS;
     }
 }

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java	2012-02-02 09:56:51 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/action/GetDataElementsForTabularAnalysisAction.java	2012-07-02 07:39:05 +0000
@@ -10,6 +10,7 @@
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
+import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.Section;
 import org.hisp.dhis.dataset.SectionService;
@@ -110,6 +111,13 @@
         return optionComboIds;
     }
 
+    private String chkValue;
+
+    public void setChkValue( String chkValue )
+    {
+        this.chkValue = chkValue;
+    }
+    
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -127,31 +135,39 @@
         } 
         else
         {
-            //DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( id );
-            
-            Section section = sectionService.getSection( id );
-            /*
-            if ( dataElementGroup != null )
-            {
-                dataElements = new ArrayList<DataElement>( dataElementGroup.getMembers() );
-            } 
-            */
-            if ( section != null )
-            {
-                dataElements = new ArrayList<DataElement>( section.getDataElements() );
-                System.out.println("section id = "+ id + " dataElements size = "+ dataElements.size());
-            }            
-            else
-            {
-                dataElements = new ArrayList<DataElement>();
+            if ( chkValue.equals( "true" ) )
+            {
+                DataElementGroup dataElementGroup = dataElementService.getDataElementGroup( id );
+                if ( dataElementGroup != null )
+                {
+                    dataElements = new ArrayList<DataElement>( dataElementGroup.getMembers() );
+                    //System.out.println( "dataElementGroup id = " + id + " dataElements size = " + dataElements.size() );
+                }
+                else
+                {
+                    dataElements = new ArrayList<DataElement>();
+                }
+            }
+            if ( chkValue.equals( "false" ) )
+            {
+                Section section = sectionService.getSection( id );
+                if ( section != null )
+                {
+                    dataElements = new ArrayList<DataElement>( section.getDataElements() );
+                    //System.out.println( "section id = " + id + " dataElements size = " + dataElements.size() );
+                }
+                else
+                {
+                    dataElements = new ArrayList<DataElement>();
+                }
             }
         }
-
+        //System.out.println( " dataElements size = " + dataElements.size() );
         Iterator<DataElement> alldeIterator = dataElements.iterator();
         while ( alldeIterator.hasNext() )
         {
             DataElement de1 = alldeIterator.next();
-            if ( !de1.getDomainType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
+            if ( !de1.getType().equals( DataElement.VALUE_TYPE_INT ) ||!de1.getDomainType().equals( DataElement.DOMAIN_TYPE_AGGREGATE ) )
            // if ( de1.getType().equals( DataElement.VALUE_TYPE_BOOL ) )
             {
                 alldeIterator.remove();

=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/GetDataElementGroupAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/GetDataElementGroupAction.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ga/action/GetDataElementGroupAction.java	2012-07-02 07:39:05 +0000
@@ -0,0 +1,98 @@
+package org.hisp.dhis.dataanalyser.ga.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.dataelement.DataElementGroup;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataset.Section;
+import org.hisp.dhis.dataset.SectionService;
+import org.hisp.dhis.dataset.comparator.SectionOrderComparator;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Mithilesh Kumar Thakur
+ *
+ * @version GetDataElementGroupAction.java Jul 2, 2012 12:05:34 PM	
+ */
+public class GetDataElementGroupAction implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
+    private SectionService sectionService;
+
+    public void setSectionService( SectionService sectionService )
+    {
+        this.sectionService = sectionService;
+    }
+    
+    
+    // -------------------------------------------------------------------------
+    // Input / Output
+    // -------------------------------------------------------------------------
+   
+    private String checkValue;
+
+    public void setCheckValue( String checkValue )
+    {
+        this.checkValue = checkValue;
+    }
+
+    public String getCheckValue()
+    {
+        return checkValue;
+    }
+
+    private List<DataElementGroup> dataElementGroups;
+
+    public List<DataElementGroup> getDataElementGroups()
+    {
+        return dataElementGroups;
+    }
+
+    private List<Section> sections;
+
+    public Collection<Section> getSections()
+    {
+        return sections;
+    }
+
+    
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    public String execute() throws Exception
+    {
+        if ( checkValue.equals( "true" ) )
+        {
+            dataElementGroups = new ArrayList<DataElementGroup>();
+            
+            //System.out.println( "Value is False" );
+            dataElementGroups = new ArrayList<DataElementGroup>( dataElementService.getAllDataElementGroups() );
+            Collections.sort( dataElementGroups, new IdentifiableObjectNameComparator() );
+        }
+        if ( checkValue.equals( "false" ) )
+        {
+            sections = new ArrayList<Section>();
+            sections = new ArrayList<Section>( sectionService.getAllSections() );
+            Collections.sort( sections, new SectionOrderComparator() );
+        }
+        
+        
+        return SUCCESS;
+    }
+}

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2012-06-27 09:23:24 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml	2012-07-02 07:39:05 +0000
@@ -143,7 +143,14 @@
         <property name="organisationUnitGroupService" ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService">
         </property>
 	</bean>
-	
+
+	<bean id="org.hisp.dhis.dataanalyser.ga.action.GetDataElementGroupAction"
+        class="org.hisp.dhis.dataanalyser.ga.action.GetDataElementGroupAction"
+        scope="prototype">
+		<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+		<property name="sectionService" ref="org.hisp.dhis.dataset.SectionService" />
+    </bean>	
+		
 	
 <!-- Graphical Analyser DataElements End -->
 		
@@ -1226,7 +1233,7 @@
         </property>
         <property name="sectionService">
             <ref bean="org.hisp.dhis.dataset.SectionService"/>
-        </property>		
+        </property>
     </bean>
 	
 		

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties'
--- local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties	2012-01-10 10:35:10 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties	2012-07-02 07:39:05 +0000
@@ -158,4 +158,5 @@
 bulk_sms = Bulk SMS
 due_dates = Due Dates
 ds_sms = DS SMS
-filter = Filter
\ No newline at end of file
+filter = Filter
+ga_filter_by_degroup_section = FilteredBy DataElementGroup / Section:
\ No newline at end of file

=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml	2012-06-05 08:26:29 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml	2012-07-02 07:39:05 +0000
@@ -126,6 +126,16 @@
 			<!--<interceptor-ref name="organisationUnitTreeStack"/>-->
 		</action>
 		
+		<action name="getDataElemetGrp"
+            class="org.hisp.dhis.dataanalyser.ga.action.GetDataElementGroupAction">
+            <result name="success" type="velocity-xml">/dhis-web-dashboard/getDataElementGrp.vm</result>
+            <!--<interceptor-ref name="transactionStack"/>-->
+            <param name="onExceptionReturn">plainTextError</param>
+        </action>		
+		
+		
+		
+		
 		<!-- GraphicalAnalyser  DataElements end   -->
 		
 		<!-- GraphicalAnalyser  Indicators -->

=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/getDataElementGrp.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/getDataElementGrp.vm	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/getDataElementGrp.vm	2012-07-02 07:39:05 +0000
@@ -0,0 +1,21 @@
+<script>
+	jQuery(document).ready(function() {
+    getDataElements();
+    });
+</script>
+<input type="hidden" id="hiddenChkValue" value="$checkValue"/>
+<select id="dataElementGroupId" name="dataElementGroupId" style="width:325px" onChange="getDataElements()" >
+	#if($checkValue=="true")
+		<option value="0" selected>[ Select DataElementGroup / All ]</option>
+    		#foreach ( $group in $dataElementGroups )
+       			<option value="$group.id" title="$group.name">$group.name</option>
+    		#end	
+	#end
+	#if($checkValue=="false")
+    	<option value="0" selected>[ Select DataElementSection / All ]</option>
+    		#foreach ( $section in $sections )
+       			<option value="$section.id" title="$section.name">$section.name</option>
+    		#end    
+    #end
+	
+</select>

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisDataElementFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisDataElementFront.vm	2012-03-19 06:07:21 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/graphicalAnalysisDataElementFront.vm	2012-07-02 07:39:05 +0000
@@ -1,4 +1,8 @@
 <script>
+	
+	jQuery(document).ready(function() {
+    	checkedDataElementGroup();    
+    });
 
 	// Global Variables
 	var selriRadioButton = "indicatorsRadio";
@@ -84,17 +88,10 @@
 <form id="ChartGenerationForm" name="ChartGenerationForm">
 	<table style=" border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" border=0>
 		<tr>
-		<td class="NormalB">$i18n.getString( "ga_filter_by_degroup" )<br>
-			<select id="dataElementGroupId" name="dataElementGroupId" style="width:325px" onChange="getDataElements()" >
-			<!--<option value="$ALL">[ Select DataElementGroup / All ]</option>-->
-				 <option value="0">[ Select DataElementGroup / All ]</option>
-				##foreach ( $group in $dataElementGroups )
-					<!--<option value="$group.id" title="$group.name">$group.name</option>-->
-				##end
-				#foreach ( $section in $sections )
-					<option value="$section.id" title="$section.name">$section.name</option>
-				#end				
-			</select>
+		<td class="NormalB">$i18n.getString( "ga_filter_by_degroup_section" )<br>
+            #parse( "dhis-web-commons/loader/loader.vm" )
+            <div id="dataElementGrpDiv" name="dataElementGrpDiv"></div>		
+			
 		</td>
 	    <td class="NormalB">&nbsp;</td>
 		<td class="NormalB">$i18n.getString( "compare_view" )<br>
@@ -113,7 +110,7 @@
     <tr>
       <td class="NormalB">$i18n.getString( "filter" ):&nbsp;<input type="text" id="availableDataElementsFilter" onkeyup="filterAvailableDataElements()" style="min-width:24em"></td>
       <td class="NormalB">&nbsp;</td>
-      <td class="NormalB">&nbsp;</td>
+      <td class="NormalB">$i18n.getString( "ga_filter_by_degroup" ) &nbsp;<input type="checkbox" checked="true" id="chkDataGrp" onchange="checkedDataElementGroup()"/></td>
     </tr>
     <tr>
 		<td class="NormalB">&nbsp;</td>

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js	2012-06-05 08:26:29 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/db.js	2012-07-02 07:39:05 +0000
@@ -1,4 +1,33 @@
 
+// for filter by dataelement group or section
+function checkedDataElementGroup()
+{
+	//var selectedDataElementGroups = document.getElementById("selectedDataElementGroups");
+	//clearList(selectedDataElementGroups);
+	jQuery('#availableDataElements').find('option').remove();
+	jQuery('#selectedDataElements').find('option').remove();
+	
+	var chkValue=null;
+	if(document.getElementById("chkDataGrp").checked==true)
+	{
+		chkValue='true';
+	}
+	else
+	{
+		chkValue='false';
+	}	
+	
+	jQuery('#loaderDiv').show();
+	jQuery('#dataElementGrpDiv').load('getDataElemetGrp.action',{
+		checkValue : chkValue
+	},
+	function(){
+		jQuery('#loaderDiv').hide();
+		
+	});	
+	 
+}
+
 function getOUDeatilsForSurvey( orgUnitIds )
 {
 	jQuery.postJSON("getOrgUnitName.action",{
@@ -243,6 +272,8 @@
 //--------------------------------------
 //
 //--------------------------------------
+
+/*
 function getDataElements()
 {
     var dataElementGroupList = document.getElementById("dataElementGroupId");
@@ -260,6 +291,7 @@
     	return false;
     }
 	*/
+/*
     if ( dataSetSectionId != null )
     {
     	document.getElementById( "availableDataElementsFilter" ).value = "";
@@ -288,7 +320,52 @@
 			getDataElementsReceived(data);
 		},'xml');
     }
-}// getDataElements end           
+}
+*/
+// getDataElements end           
+
+// getDataElements Start  
+function getDataElements()
+{
+    var checkValue = document.getElementById("hiddenChkValue").value;    
+    var dataElementGroupList = document.getElementById("dataElementGroupId");
+    var dataElementGroupId = dataElementGroupList.options[ dataElementGroupList.selectedIndex ].value;    
+    
+    var deSelectionList = document.getElementById("deSelection");    
+    var deOptionValue = deSelectionList.options[ deSelectionList.selectedIndex ].value;
+    
+    if ( dataElementGroupId != null )
+    {
+    	document.getElementById( "availableDataElementsFilter" ).value = "";
+    	document.getElementById( "availableDataElementsFilter" ).disabled = true;
+    	
+        if ( dataElementGroupId == 0 )
+        {
+        	document.getElementById( "availableDataElementsFilter" ).value = "";
+        	document.getElementById( "availableDataElementsFilter" ).disabled = false;
+        }
+        else
+        {
+        	document.getElementById( "availableDataElementsFilter" ).value = "";
+        	document.getElementById( "availableDataElementsFilter" ).disabled = true;
+        }
+    	
+        lockScreen();
+    	$.post("getDataElements.action",
+		{
+			 id:dataElementGroupId,
+			 chkValue:checkValue,
+			 deOptionValue:deOptionValue
+		},
+		function (data)
+		{
+			getDataElementsReceived(data);
+		},'xml');
+    }
+}
+// getDataElements end   
+
+
 
 function getDataElementsWithOutOptionCombo()
 {

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js	2012-04-30 11:56:21 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ta.js	2012-07-02 07:39:05 +0000
@@ -1,3 +1,28 @@
+// for filter by dataelement group or section
+function checkedDataElementGroup()
+{
+	//var selectedDataElementGroups = document.getElementById("selectedDataElementGroups");
+	//clearList(selectedDataElementGroups);
+	jQuery('#availableDataElements').find('option').remove();
+	jQuery('#selectedServices').find('option').remove();
+	var chkValue=null;
+	if(document.getElementById("chkDataGrp").checked==true)
+	{
+		chkValue='true';
+	}
+	else
+	{
+		chkValue='false';
+	}	
+	jQuery('#loaderDiv').show();
+	jQuery('#dataElementGrpDiv2').load('getDataElemetGrp.action',{
+		checkValue : chkValue
+	},
+	function(){
+		jQuery('#loaderDiv').hide();
+		
+	});	
+}
 
 
 function ouListSelection()
@@ -248,7 +273,53 @@
 	
     getDataElements();
 }
-
+// getDataElements start  
+function getDataElements()
+{
+	var checkValue = document.getElementById("hiddenChkValue").value;
+    var dataElementGroupList = document.getElementById("dataElementGroupId");
+    //var dataElementGroupId = dataElementGroupList.options[ dataElementGroupList.selectedIndex ].value;
+    
+    var dataSetSectionId = dataElementGroupList.options[ dataElementGroupList.selectedIndex ].value;
+    
+    var deSelectionList = document.getElementById("deSelection");    
+    var deOptionValue = deSelectionList.options[ deSelectionList.selectedIndex ].value;
+    
+    if ( dataSetSectionId != null )
+    {
+    	document.getElementById( "availableDataElementsFilter" ).value = "";
+    	document.getElementById( "availableDataElementsFilter" ).disabled = true;
+    	
+        if ( dataSetSectionId == 0 )
+        {
+        	document.getElementById( "availableDataElementsFilter" ).value = "";
+        	document.getElementById( "availableDataElementsFilter" ).disabled = false;
+        }
+        else
+        {
+        	document.getElementById( "availableDataElementsFilter" ).value = "";
+        	document.getElementById( "availableDataElementsFilter" ).disabled = true;
+        }    	
+        lockScreen();
+        
+    	$.post("getDataElementsForTA.action",
+		{
+			id:dataSetSectionId,
+			chkValue:checkValue,
+			deOptionValue:deOptionValue
+		},
+		function (data)
+		{
+			getDataElementsReceived(data);
+		},'xml');
+    }
+}
+	
+// getDataElements end   
+
+
+
+/*
 function getDataElements()
 {
     var dataElementGroupList = document.getElementById("dataElementGroupId");
@@ -286,7 +357,9 @@
 			getDataElementsReceived(data);
 		},'xml');
     }
-}// getDataElements end           
+}
+*/
+// getDataElements end           
 
 function getDataElementsReceived( xmlObject )
 {

=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm	2012-04-30 11:56:21 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/tabularAnalysisFront.vm	2012-07-02 07:39:05 +0000
@@ -17,7 +17,11 @@
 <div id="overlay">
     <div id="overlayImg"><img  width="50" height="50" src="images/ajax-loader.gif" /></div>
 </div>
-
+<script>
+    jQuery(document).ready(function() {
+    checkedDataElementGroup();    
+    });
+</script>
 <script>
     
     // Global Variables
@@ -118,16 +122,9 @@
         </colgroup>
 
         <tr>
-            <td class="NormalB">$i18n.getString( "ga_filter_by_degroup" )<br>
-                <select id="dataElementGroupId" name="dataElementGroupId" style="width:350px" onchange="getDataElements()">
-                    <option value="0">[ Select DataElementGroup / All ]</option>                                    
-                        ##foreach ( $degroup in $dataElementGroups )
-                        	<!--<option value="$degroup.id" title="$degroup.name">$degroup.name</option>-->                 
-                    	##end
-                        #foreach ( $section in $sections )
-                        	<option value="$section.id" title="$section.name">$section.name</option>            
-                    	#end                    
-                </select>
+            <td class="NormalB">$i18n.getString( "ga_filter_by_degroup_section" )<br>
+                #parse( "dhis-web-commons/loader/loader.vm" )
+                <div id="dataElementGrpDiv2" name="dataElementGrpDiv2"></div>
             </td>   
             <td class="NormalB">&nbsp;</td>
             <td class="NormalB">$i18n.getString( "compare_view" )<br>
@@ -146,7 +143,7 @@
         <tr>
      	    <td class="NormalB">$i18n.getString( "filter" ):&nbsp;<input type="text" id="availableDataElementsFilter" onkeyup="filterAvailableDataElements()" style="min-width:26em"></td>
             <td class="NormalB">&nbsp;</td>
-            <td class="NormalB">&nbsp;</td>
+            <td class="NormalB">$i18n.getString( "ga_filter_by_degroup" ) &nbsp;<input type="checkbox" checked="true" id="chkDataGrp" onchange="checkedDataElementGroup()"/></td>
         </tr>                           
         <tr>
             <td class="NormalB">$i18n.getString( "ga_available_delist" )<br>

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties'
--- local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties	2012-06-30 10:19:34 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/org/hisp/dhis/reports/i18n_module.properties	2012-07-02 07:39:05 +0000
@@ -340,4 +340,4 @@
 download = Download New RA-Folder
 selected_delist = Selected dataelements
 discharge = Discharge
-followup = Followup
+followup = Followup
\ No newline at end of file