← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3758: added remaining paging (also fixes a plethora of paging related bugs). Also fixed add/update org ...

 

------------------------------------------------------------
revno: 3758
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-05-26 16:44:02 +0200
message:
  added remaining paging (also fixes a plethora of paging related bugs). Also fixed add/update org unit group set bugs.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js	2011-05-24 07:32:08 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js	2011-05-26 14:44:02 +0000
@@ -33,6 +33,13 @@
 // Support functions
 // -----------------------------------------------
 
+// Array Remove - By John Resig (MIT Licensed)
+Array.remove = function(array, from, to) {
+  var rest = array.slice((to || from) + 1 || array.length);
+  array.length = from < 0 ? array.length + from : from;
+  return array.push.apply(array, rest);
+};
+
 /* perform dblclick action on the sourceId */
 function dhisPaging_moveAllSelected(sourceId)
 {
@@ -99,10 +106,11 @@
             if( jQuery.isArray(settings[removeArray]) )
             {
                 var remove_idx = jQuery.inArray(option_id, settings[removeArray]);
-                settings[removeArray].splice(remove_idx, remove_idx+1);
+                Array.remove(settings[removeArray], remove_idx, remove_idx);
+                //settings[removeArray].splice(remove_idx, remove_idx+1);
             }
         });
-    
+
         if(settings[removeArray] && settings[removeArray].length > 0) {
             settings.params[removeArray] = settings[removeArray].join(",");
         } else {

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java	2011-05-25 13:17:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementGroupsAction.java	2011-05-26 14:44:02 +0000
@@ -33,6 +33,7 @@
 import java.util.List;
 
 import org.hisp.dhis.dataelement.DataElementGroup;
+import org.hisp.dhis.dataelement.DataElementGroupSet;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
@@ -62,6 +63,13 @@
     // Input & output
     // -------------------------------------------------------------------------
 
+    private Integer includeDataElementGroupId;
+
+    public void setIncludeDataElementGroupId( Integer includeDataElementGroupId )
+    {
+        this.includeDataElementGroupId = includeDataElementGroupId;
+    }
+
     private String key;
 
     public void setKey( String key )
@@ -110,6 +118,12 @@
         if ( filterNoGroupSet )
         {
             FilterUtils.filter( dataElementGroups, new DataElementGroupWithoutGroupSetFilter() );
+
+            if ( includeDataElementGroupId != null )
+            {
+                DataElementGroupSet groupSet = dataElementService.getDataElementGroupSet( includeDataElementGroupId );
+                dataElementGroups.addAll( groupSet.getMembers() );
+            }
         }
 
         if ( removeDataElementGroups.size() > 0 )

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java	2011-05-25 13:19:47 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetIndicatorGroupsAction.java	2011-05-26 14:44:02 +0000
@@ -33,6 +33,7 @@
 import java.util.List;
 
 import org.hisp.dhis.indicator.IndicatorGroup;
+import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.indicator.comparator.IndicatorGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
@@ -61,6 +62,13 @@
     // Input & Output
     // -------------------------------------------------------------------------
 
+    private Integer includeIndicatorGroupSetId;
+
+    public void setIncludeIndicatorGroupSetId( Integer includeIndicatorGroupId )
+    {
+        this.includeIndicatorGroupSetId = includeIndicatorGroupId;
+    }
+
     private String key;
 
     public void setKey( String key )
@@ -108,6 +116,12 @@
         if ( filterNoGroupSet )
         {
             FilterUtils.filter( indicatorGroups, new IndicatorGroupWIthoutGroupSetFilter() );
+
+            if ( includeIndicatorGroupSetId != null )
+            {
+                IndicatorGroupSet groupSet = indicatorService.getIndicatorGroupSet( includeIndicatorGroupSetId );
+                indicatorGroups.addAll( groupSet.getMembers() );
+            }
         }
 
         if ( removeIndicatorGroups.size() > 0 )

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java	2011-05-26 12:49:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitGroupsAction.java	2011-05-26 14:44:02 +0000
@@ -34,6 +34,7 @@
 
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
 import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator;
 import org.hisp.dhis.paging.ActionPagingSupport;
 import org.hisp.dhis.system.filter.OrganisationUnitGroupWithoutGroupSetFilter;
@@ -62,6 +63,13 @@
     // Input & output
     // -------------------------------------------------------------------------
 
+    private Integer includeOrganisationUnitGroupId;
+
+    public void setIncludeOrganisationUnitGroupId( Integer includeOrganisationUnitGroupId )
+    {
+        this.includeOrganisationUnitGroupId = includeOrganisationUnitGroupId;
+    }
+
     private String key;
 
     public void setKey( String key )
@@ -112,6 +120,13 @@
         if ( filterNoGroupSet )
         {
             FilterUtils.filter( organisationUnitGroups, new OrganisationUnitGroupWithoutGroupSetFilter() );
+
+            if ( includeOrganisationUnitGroupId != null )
+            {
+                OrganisationUnitGroupSet groupSet = organisationUnitGroupService
+                    .getOrganisationUnitGroupSet( includeOrganisationUnitGroupId );
+                organisationUnitGroups.addAll( groupSet.getOrganisationUnitGroups() );
+            }
         }
 
         if ( removeOrganisationUnitGroups.size() > 0 )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm	2011-05-24 17:04:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm	2011-05-26 14:44:02 +0000
@@ -13,9 +13,9 @@
 	jQuery(function() {
 		jQuery("#availableDataElementsList").dblclick(dhisPaging_availableList_dblclick("availableDataElementsList", "groupMembers", "removeDataElements"));
 		jQuery("#groupMembers").dblclick(dhisPaging_selectedList_dblclick("groupMembers", "availableDataElementsList", "removeDataElements"));
-	
+
 		var removeDataElementsList = getRemoveDataElements();
-	
+
 		jQuery("#availableDataElementsList").dhisPaging({
 			source: "../dhis-web-commons-ajax-json/getDataElements.action",
 			iterator: "dataElements",

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm	2011-05-25 13:17:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupSet.vm	2011-05-26 14:44:02 +0000
@@ -29,6 +29,7 @@
 			removeDataElementGroups: removeDataElementGroupsList,
 			params: {
 				filterNoGroupSet: true,
+				includeDataElementGroupId: $dataElementGroupSet.id,
 				removeDataElementGroups: removeDataElementGroupsList.join(",")
 			}
 		});
@@ -38,7 +39,9 @@
 <h3>$i18n.getString( "update_dataelementgroupset" ) : $dataElementGroupSet.name</h3>
 
 <form id="updateDataElementGroupSet" action="updateDataElementGroupSet.action" method="post">
+
 <input type=hidden id="id" name="id" value="$dataElementGroupSet.id"/>
+
 <table>
 	<tr>
 		<th colspan="2">$i18n.getString( "details" )</th>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm	2011-05-25 13:17:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupSet.vm	2011-05-26 14:44:02 +0000
@@ -3,11 +3,11 @@
 	function getRemoveIndicatorGroups() {
 		var list = [
 		#foreach( $indicatorGroup in $selectedGroups )
-            ${indicatorGroup.id}
+            ${indicatorGroup.id},
         #end
 		];
 
-		return list;	
+		return list;
 	}
 
 	jQuery(document).ready(	function() {
@@ -29,6 +29,7 @@
 			removeIndicatorGroups: removeIndicatorGroupsList,
 			params: {
 				filterNoGroupSet: true,
+				includeIndicatorGroupSetId: $indicatorGroupSet.id,
 				removeIndicatorGroups: removeIndicatorGroupsList.join(",")
 			}
 		});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm	2011-03-16 16:52:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm	2011-05-26 14:44:02 +0000
@@ -1,8 +1,30 @@
 <script type="text/javascript" src="javascript/addOrganisationUnitGroupSetForm.js"></script>
+<script type="text/javascript">
+	jQuery(function() {
+		jQuery("#availableGroups").dblclick(dhisPaging_availableList_dblclick("availableGroups", "selectedGroups", "removeOrganisationUnitGroups"));
+		jQuery("#selectedGroups").dblclick(dhisPaging_selectedList_dblclick("selectedGroups", "availableGroups", "removeOrganisationUnitGroups"));
+
+		jQuery("#availableGroups").dhisPaging({
+			source: "../dhis-web-commons-ajax-json/getOrganisationUnitGroups.action",
+			iterator: "organisationUnitGroups",
+			handler: function(item) {
+				var option = jQuery("<option />");
+				option.text( item.name );
+				option.attr( "value", item.id );
+
+				return option;
+			},
+			params: {
+				filterNoGroupSet: true
+			}
+		});
+	});
+</script>
 
 <h3>$i18n.getString( "create_new_org_unit_group_set" ) #openHelp( "ou_groupsets_edit" )</h3>
 
 <form id="addOrganisationUnitGroupSetForm" action="addOrganisationUnitGroupSet.action" method="post" >
+
 <table>
 	<tr>
 		<th colspan="2">$i18n.getString( "details" )</th>
@@ -35,50 +57,38 @@
 
 <table>
 	<colgroup>
-  		<col width="325px"/>
-  		<col width="80px"/>
- 		<col width="325px"/>
+	    <col style="width: 450px"/>
+	    <col/>
+	    <col/>
   	</colgroup>
 	
   	<tr>
   		<th>$i18n.getString( "available_groups" )</th>
-  		<td></td>
+  		<th></th>
   		<th>$i18n.getString( "selected_groups" )</th>
 	</tr>
-	<tr>       
-        <td><input type="text" onkeyup="filterList( this.value, 'availableGroups' )" style="width:25em"/></td>
-        <td style="text-align:center">&lt; $i18n.getString( "filters" ) &gt;</td>
-        <td><input type="text" onkeyup="filterList( this.value, 'selectedGroups' )" style="width:25em"/></td>
-    </tr>
+
 	<tr>
 		<td>
-			<select multiple size="8" id="availableGroups" name="availableGroups" style="width:100%" ondblclick="moveSelectedById( 'availableGroups', 'selectedGroups' )">
-				#foreach ( $group in $availableGroups )
-    				<option value="$group.id">$group.name</option>
-    			#end
-			</select>
+			<select id="availableGroups" name="availableGroups" multiple="multiple" style="height: 200px; width: 100%;"></select>
 		</td>
+
 		<td style="text-align:center">
-			<input type="button" value="&gt;" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availableGroups', 'selectedGroups' )"/><br/>
-			<input type="button" value="&lt;" title="$i18n.getString('move_all')" style="width:50px" onclick="moveSelectedById( 'selectedGroups', 'availableGroups' )"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveAllById( 'availableGroups', 'selectedGroups' )"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedGroups', 'availableGroups' )"/>
+        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisPaging_moveAllSelected( 'availableGroups' );"/><br/>
+            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisPaging_moveAllSelected( 'selectedGroups' );"/><br/>
+			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisPaging_moveAll( 'availableGroups' );"/><br/>
+			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisPaging_moveAll( 'selectedGroups' );"/>
 		</td>
+
 		<td>
-			<select multiple size="8" id="selectedGroups" name="selectedGroups" style="width:100%" ondblclick="moveSelectedById( 'selectedGroups', 'availableGroups' )">
-			</select>
+			<select id="selectedGroups" name="selectedGroups" multiple="multiple" style="height: 100%; width: 100%;"></select>
 		</td>
 	</tr>
-	
-    <tr>
-        <td colspan="3" style="height:15px"></td>
-    </tr>
-    
-	<tr>
-		<td colspan="3">
-			<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>
-			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnitGroupSet.action'" style="width:10em"/>
-		</td>		
-	</tr>
 </table>
+
+<p>
+	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em" />
+	<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnitGroupSet.action'" style="width:10em" />
+</p>
+
 </form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js	2011-04-11 11:36:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/addOrganisationUnitGroupSetForm.js	2011-05-26 14:44:02 +0000
@@ -1,6 +1,6 @@
 jQuery(document).ready(function() {
 	validation2('addOrganisationUnitGroupSetForm', function(form) {
-		validateAddOrganisationGroupSet(form)
+	    form.submit();
 	}, {
 		'beforeValidateHandler' : function() {
 			selectAllById('selectedGroups');

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js	2011-04-11 11:36:18 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/updateOrganisationUnitGroupSetForm.js	2011-05-26 14:44:02 +0000
@@ -1,6 +1,6 @@
 jQuery(document).ready(function() {
 	validation2('updateOrganisationUnitGroupSetForm', function(form) {
-		validateAddOrganisationGroupSet(form)
+	    form.submit();
 	}, {
 		'beforeValidateHandler' : function() {
 			selectAllById('selectedGroups');
@@ -8,9 +8,5 @@
 		'rules' : getValidationRules("organisationUnitGroupSet")
 	});
 
-	checkValueIsExist("name", "validateOrganisationUnitGroupSet.action", {
-		id : $organisationUnitGroupSet.id
-	});
-
 	changeCompulsory(getFieldValue('compulsory'));
 });

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm	2011-03-16 16:52:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm	2011-05-26 14:44:02 +0000
@@ -1,12 +1,53 @@
 <script type="text/javascript" src="javascript/updateOrganisationUnitGroupSetForm.js"></script>
 <script type="text/javascript">
+	function getRemoveOrganisationUnitGroups() {
+		var list = [
+		#foreach ( $group in $selectedGroups )
+			${group.id},
+		#end
+		];
+		
+		return list;	
+	}
+
+	jQuery(function() {
+		jQuery("#availableGroups").dblclick(dhisPaging_availableList_dblclick("availableGroups", "selectedGroups", "removeOrganisationUnitGroups"));
+		jQuery("#selectedGroups").dblclick(dhisPaging_selectedList_dblclick("selectedGroups", "availableGroups", "removeOrganisationUnitGroups"));
+
+		var removeOrganisationUnitGroupsList = getRemoveOrganisationUnitGroups();
+
+		jQuery("#availableGroups").dhisPaging({
+			source: "../dhis-web-commons-ajax-json/getOrganisationUnitGroups.action",
+			iterator: "organisationUnitGroups",
+			handler: function(item) {
+				var option = jQuery("<option />");
+				option.text( item.name );
+				option.attr( "value", item.id );
+
+				return option;
+			},
+			removeOrganisationUnitGroups: removeOrganisationUnitGroupsList,
+			params: {
+				filterNoGroupSet: true,
+				includeOrganisationUnitGroupId: $organisationUnitGroupSet.id,
+				removeOrganisationUnitGroups: removeOrganisationUnitGroupsList.join(",")
+			}
+		});
+
+		checkValueIsExist("name", "validateOrganisationUnitGroupSet.action", {
+			id : $organisationUnitGroupSet.id
+		});
+	});
+
 	var saving_the_org_unit_group_set_failed = '$encoder.jsEscape( $i18n.getString( "saving_the_org_unit_group_set_failed" ) , "'" )';	
 </script>
 
 <h3>$i18n.getString( "edit_org_unit_group_set" ) #openHelp( "ou_groupsets_edit" )</h3>
 
 <form id="updateOrganisationUnitGroupSetForm" action="updateOrganisationUnitGroupSet.action" method="post" >
+
 <input type="hidden" id="id" name="id" value="$organisationUnitGroupSet.id"/>
+
 <table>
 	<tr>
 		<th colspan="2">$i18n.getString( "details" )</th>
@@ -39,53 +80,42 @@
 
 <table>
 	<colgroup>
-  		<col width="325px"/>
-  		<col width="80px"/>
- 		<col width="325px"/>
+	    <col style="width: 450px"/>
+	    <col/>
+	    <col/>
   	</colgroup>
 	
   	<tr>
   		<th>$i18n.getString( "available_groups" )</th>
-  		<td></td>
+  		<th></th>
   		<th>$i18n.getString( "selected_groups" )</th>
 	</tr>
-    <tr>       
-        <td><input type="text" onkeyup="filterList( this.value, 'availableGroups' )" style="width:25em"/></td>
-        <td style="text-align:center">&lt; $i18n.getString( "filters" ) &gt;</td>
-        <td><input type="text" onkeyup="filterList( this.value, 'selectedGroups' )" style="width:25em"/></td>
-    </tr>
+
 	<tr>
 		<td>
-			<select multiple size="8" id="availableGroups" name="availableGroups" style="width:100%" ondblclick="moveSelectedById( 'availableGroups', 'selectedGroups' )">
-				#foreach ( $group in $availableGroups )
-    				<option value="$group.id">$group.name</option>
-    			#end
-			</select>
+			<select id="availableGroups" name="availableGroups" multiple="multiple" style="height: 200px; width: 100%;"></select>
 		</td>
+
 		<td style="text-align:center">
-			<input type="button" value="&gt;" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availableGroups', 'selectedGroups' )"/><br/>
-			<input type="button" value="&lt;" title="$i18n.getString('move_all')" style="width:50px" onclick="moveSelectedById( 'selectedGroups', 'availableGroups' )"/><br/>		
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveAllById( 'availableGroups', 'selectedGroups' )"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedGroups', 'availableGroups' )"/>
+        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisPaging_moveAllSelected( 'availableGroups' );"/><br/>
+            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisPaging_moveAllSelected( 'selectedGroups' );"/><br/>
+			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisPaging_moveAll( 'availableGroups' );"/><br/>
+			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisPaging_moveAll( 'selectedGroups' );"/>
 		</td>
+
 		<td>
-			<select multiple size="8" id="selectedGroups" name="selectedGroups" style="width:100%" ondblclick="moveSelectedById( 'selectedGroups', 'availableGroups' )">
+			<select id="selectedGroups" name="selectedGroups" multiple="multiple" style="height: 100%; width: 100%;">
 				#foreach ( $group in $selectedGroups )
     				<option value="$group.id">$group.name</option>
     			#end
 			</select>
 		</td>
 	</tr>
-	
-    <tr>
-        <td colspan="3" style="height:15px"></td>
-    </tr>
-	    
-	<tr>
-		<td colspan="3">
-			<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
-			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnitGroupSet.action'" style="width:10em"/>
-		</td>		
-	</tr>
 </table>
+
+<p>
+	<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
+	<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='organisationUnitGroupSet.action'" style="width:10em"/>
+</p>
+
 </form>