← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16798: update to use new available/selected plugin in inGroup, deGroup, dataDictionary

 

------------------------------------------------------------
revno: 16798
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-09-24 18:57:54 +0700
message:
  update to use new available/selected plugin in inGroup, deGroup, dataDictionary
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/AddDataDictionaryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/UpdateDataDictionaryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/AddDataElementGroupAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/ShowUpdateDataElementGroupFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/UpdateDataElementGroupAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/AddIndicatorGroupAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/UpdateIndicatorGroupAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm
  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/updateIndicatorGroupForm.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/macros.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-08-05 13:28:23 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/macros.vm	2014-09-24 11:57:54 +0000
@@ -431,7 +431,6 @@
       <th>$i18n.getString( $args.i18n_selected )
           #if( $required )
             <em title="$i18n.getString( 'required' )" class="required">*</em>
-            <select id="${args.prefix}Validator" style="display:none"></select>
           #end
       </th>
     </tr>
@@ -466,4 +465,7 @@
     </tr>
     </tbody>
 </table>
+
+<select id="${args.prefix}Validator" style="display:none"></select>
+
 #end

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/AddDataDictionaryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/AddDataDictionaryAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/AddDataDictionaryAction.java	2014-09-24 11:57:54 +0000
@@ -36,8 +36,9 @@
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
@@ -99,18 +100,18 @@
         this.region = region;
     }
 
-    private Collection<String> selectedDataElements;
+    private List<String> deSelected = new ArrayList<>();
 
-    public void setSelectedDataElements( Collection<String> groupMembers )
+    public void setDeSelected( List<String> deSelected )
     {
-        this.selectedDataElements = groupMembers;
+        this.deSelected = deSelected;
     }
 
-    private Collection<String> selectedIndicators;
+    private List<String> inSelected = new ArrayList<>();
 
-    public void setSelectedIndicators( Collection<String> indicators )
+    public void setInSelected( List<String> indicators )
     {
-        this.selectedIndicators = indicators;
+        this.inSelected = indicators;
     }
 
     // -------------------------------------------------------------------------
@@ -125,13 +126,13 @@
         dictionary.setDescription( nullIfEmpty( description ) );
         dictionary.setRegion( nullIfEmpty( region ) );
 
-        if ( selectedDataElements != null )
+        if ( deSelected != null )
         {
-            Set<DataElement> members = new HashSet<>( selectedDataElements.size() );
+            Set<DataElement> members = new HashSet<>( deSelected.size() );
 
-            for ( String id : selectedDataElements )
+            for ( String id : deSelected )
             {
-                members.add( dataElementService.getDataElement( Integer.parseInt( id ) ) );
+                members.add( dataElementService.getDataElement( id ) );
             }
 
             dictionary.setDataElements( members );
@@ -141,13 +142,13 @@
             dictionary.setDataElements( new HashSet<DataElement>() );
         }
 
-        if ( selectedIndicators != null )
+        if ( inSelected != null )
         {
-            Set<Indicator> members = new HashSet<>( selectedIndicators.size() );
+            Set<Indicator> members = new HashSet<>( inSelected.size() );
 
-            for ( String id : selectedIndicators )
+            for ( String id : inSelected )
             {
-                members.add( indicatorService.getIndicator( Integer.parseInt( id ) ) );
+                members.add( indicatorService.getIndicator( id ) );
             }
 
             dictionary.setIndicators( members );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/UpdateDataDictionaryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/UpdateDataDictionaryAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/datadictionary/UpdateDataDictionaryAction.java	2014-09-24 11:57:54 +0000
@@ -36,8 +36,9 @@
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 
 import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty;
@@ -106,18 +107,18 @@
         this.region = region;
     }
 
-    private Collection<String> selectedDataElements;
+    private List<String> deSelected = new ArrayList<>();
 
-    public void setSelectedDataElements( Collection<String> groupMembers )
+    public void setDeSelected( List<String> deSelected )
     {
-        this.selectedDataElements = groupMembers;
+        this.deSelected = deSelected;
     }
 
-    private Collection<String> selectedIndicators;
+    private List<String> inSelected = new ArrayList<>();
 
-    public void setSelectedIndicators( Collection<String> indicators )
+    public void setInSelected( List<String> indicators )
     {
-        this.selectedIndicators = indicators;
+        this.inSelected = indicators;
     }
 
     // -------------------------------------------------------------------------
@@ -132,13 +133,13 @@
         dictionary.setDescription( nullIfEmpty( description ) );
         dictionary.setRegion( nullIfEmpty( region ) );
 
-        if ( selectedDataElements != null )
+        if ( deSelected != null )
         {
-            Set<DataElement> members = new HashSet<>( selectedDataElements.size() );
+            Set<DataElement> members = new HashSet<>( deSelected.size() );
 
-            for ( String id : selectedDataElements )
+            for ( String id : deSelected )
             {
-                members.add( dataElementService.getDataElement( Integer.parseInt( id ) ) );
+                members.add( dataElementService.getDataElement( id ) );
             }
 
             dictionary.setDataElements( members );
@@ -148,13 +149,13 @@
             dictionary.setDataElements( new HashSet<DataElement>() );
         }
 
-        if ( selectedIndicators != null )
+        if ( inSelected != null )
         {
-            Set<Indicator> members = new HashSet<>( selectedIndicators.size() );
+            Set<Indicator> members = new HashSet<>( inSelected.size() );
 
-            for ( String id : selectedIndicators )
+            for ( String id : inSelected )
             {
-                members.add( indicatorService.getIndicator( Integer.parseInt( id ) ) );
+                members.add( indicatorService.getIndicator( id ) );
             }
 
             dictionary.setIndicators( members );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/AddDataElementGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/AddDataElementGroupAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/AddDataElementGroupAction.java	2014-09-24 11:57:54 +0000
@@ -28,17 +28,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.google.common.collect.Lists;
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-
-import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.system.util.AttributeUtils;
 
+import java.util.List;
+
 /**
  * @author Torgeir Lorange Ostby
  * @version $Id: AddDataElementGroupAction.java 2869 2007-02-20 14:26:09Z
@@ -90,11 +88,11 @@
         this.code = code;
     }
 
-    private Set<String> groupMembers = new HashSet<>();
+    private List<String> deSelected = Lists.newArrayList();
 
-    public void setGroupMembers( Set<String> groupMembers )
+    public void setDeSelected( List<String> deSelected )
     {
-        this.groupMembers = groupMembers;
+        this.deSelected = deSelected;
     }
 
     private List<String> jsonAttributeValues;
@@ -121,15 +119,16 @@
 
     public String execute()
     {
-        code = ( code != null && code.trim().length() == 0 ) ? null : code;
-        
+        code = (code != null && code.trim().length() == 0) ? null : code;
+
         dataElementGroup = new DataElementGroup( name );
         dataElementGroup.setShortName( shortName );
         dataElementGroup.setCode( code );
-        
-        for ( String id : groupMembers )
+
+        for ( String id : deSelected )
         {
-            dataElementGroup.addDataElement( dataElementService.getDataElement( Integer.parseInt( id ) ) );
+            System.err.println( "id: " + id );
+            dataElementGroup.addDataElement( dataElementService.getDataElement( id ) );
         }
 
         if ( jsonAttributeValues != null )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/ShowUpdateDataElementGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/ShowUpdateDataElementGroupFormAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/ShowUpdateDataElementGroupFormAction.java	2014-09-24 11:57:54 +0000
@@ -101,11 +101,11 @@
         return dataElementGroup;
     }
 
-    private List<DataElement> groupMembers = new ArrayList<>();
+    private List<DataElement> dataElements = new ArrayList<>();
 
-    public List<DataElement> getGroupMembers()
+    public List<DataElement> getDataElements()
     {
-        return groupMembers;
+        return dataElements;
     }
 
     // -------------------------------------------------------------------------
@@ -120,13 +120,13 @@
 
         dataElementGroup = dataElementService.getDataElementGroup( id, true );
 
-        groupMembers = new ArrayList<>( dataElementGroup.getMembers() );
+        dataElements = new ArrayList<>( dataElementGroup.getMembers() );
 
         attributes = new ArrayList<>( attributeService.getDataElementGroupAttributes() );
 
         attributeValues = AttributeUtils.getAttributeValueMap( dataElementGroup.getAttributeValues() );
 
-        Collections.sort( groupMembers, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, AttributeSortOrderComparator.INSTANCE );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/UpdateDataElementGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/UpdateDataElementGroupAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelementgroup/UpdateDataElementGroupAction.java	2014-09-24 11:57:54 +0000
@@ -28,18 +28,18 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.google.common.collect.Lists;
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementService;
-
-import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.system.util.AttributeUtils;
 
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 /**
  * @author Torgeir Lorange Ostby
  * @version $Id: UpdateDataElementGroupAction.java 2869 2007-02-20 14:26:09Z
@@ -98,11 +98,11 @@
         this.code = code;
     }
 
-    private Set<String> groupMembers = new HashSet<>();
+    private List<String> deSelected = Lists.newArrayList();
 
-    public void setGroupMembers( Set<String> groupMembers )
+    public void setDeSelected( List<String> deSelected )
     {
-        this.groupMembers = groupMembers;
+        this.deSelected = deSelected;
     }
 
     private List<String> jsonAttributeValues;
@@ -129,12 +129,12 @@
 
     public String execute()
     {
-        code = ( code != null && code.trim().length() == 0 ) ? null : code;
-        
+        code = (code != null && code.trim().length() == 0) ? null : code;
+
         dataElementGroup = dataElementService.getDataElementGroup( id );
         dataElementGroup.setShortName( shortName );
         dataElementGroup.setCode( code );
-        
+
         if ( name != null && name.trim().length() > 0 )
         {
             dataElementGroup.setName( name );
@@ -142,9 +142,9 @@
 
         Set<DataElement> members = new HashSet<>();
 
-        for ( String id : groupMembers )
+        for ( String id : deSelected )
         {
-            members.add( dataElementService.getDataElement( Integer.parseInt( id ) ) );
+            members.add( dataElementService.getDataElement( id ) );
         }
 
         if ( jsonAttributeValues != null )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/AddIndicatorGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/AddIndicatorGroupAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/AddIndicatorGroupAction.java	2014-09-24 11:57:54 +0000
@@ -28,19 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import com.google.common.collect.Lists;
 import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.system.util.AttributeUtils;
 
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
 /**
  * @author Torgeir Lorange Ostby
- * @version $Id: AddIndicatorGroupAction.java 3305 2007-05-14 18:55:52Z larshelg $
  */
 public class AddIndicatorGroupAction
     implements Action
@@ -74,11 +72,11 @@
         this.name = name;
     }
 
-    private Set<String> groupMembers = new HashSet<>();
+    private List<String> inSelected = Lists.newArrayList();
 
-    public void setGroupMembers( Set<String> groupMembers )
+    public void setInSelected( List<String> inSelected )
     {
-        this.groupMembers = groupMembers;
+        this.inSelected = inSelected;
     }
 
     private IndicatorGroup indicatorGroup;
@@ -105,9 +103,9 @@
 
         indicatorService.addIndicatorGroup( indicatorGroup );
 
-        for ( String id : groupMembers )
+        for ( String id : inSelected )
         {
-            indicatorGroup.addIndicator( indicatorService.getIndicator( Integer.parseInt( id ) ) );
+            indicatorGroup.addIndicator( indicatorService.getIndicator( id ) );
         }
 
         if ( jsonAttributeValues != null )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java	2014-09-24 11:57:54 +0000
@@ -83,11 +83,11 @@
         return indicatorGroup;
     }
 
-    private List<Indicator> groupMembers = new ArrayList<>();
+    private List<Indicator> indicators = new ArrayList<>();
 
-    public List<Indicator> getGroupMembers()
+    public List<Indicator> getIndicators()
     {
-        return groupMembers;
+        return indicators;
     }
 
     private List<Attribute> attributes;
@@ -112,13 +112,13 @@
     {
         indicatorGroup = indicatorService.getIndicatorGroup( id, true );
 
-        groupMembers = new ArrayList<>( indicatorGroup.getMembers() );
+        indicators = new ArrayList<>( indicatorGroup.getMembers() );
 
         attributes = new ArrayList<>( attributeService.getIndicatorGroupAttributes() );
 
         attributeValues = AttributeUtils.getAttributeValueMap( indicatorGroup.getAttributeValues() );
 
-        Collections.sort( groupMembers, IdentifiableObjectNameComparator.INSTANCE );
+        Collections.sort( indicators, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, AttributeSortOrderComparator.INSTANCE );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/UpdateIndicatorGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/UpdateIndicatorGroupAction.java	2014-08-15 07:40:20 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/UpdateIndicatorGroupAction.java	2014-09-24 11:57:54 +0000
@@ -28,22 +28,20 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
+import com.google.common.collect.Lists;
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
-
-import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.system.util.AttributeUtils;
 
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 /**
  * @author Torgeir Lorange Ostby
- * @version $Id: UpdateIndicatorGroupAction.java 3305 2007-05-14 18:55:52Z
- *          larshelg $
  */
 public class UpdateIndicatorGroupAction
     implements Action
@@ -84,11 +82,11 @@
         this.name = name;
     }
 
-    private Set<String> groupMembers = new HashSet<>();
+    private List<String> inSelected = Lists.newArrayList();
 
-    public void setGroupMembers( Set<String> groupMembers )
+    public void setInSelected( List<String> inSelected )
     {
-        this.groupMembers = groupMembers;
+        this.inSelected = inSelected;
     }
 
     private IndicatorGroup indicatorGroup;
@@ -120,9 +118,9 @@
 
         Set<Indicator> members = new HashSet<>();
 
-        for ( String memberId : groupMembers )
+        for ( String id : inSelected )
         {
-            members.add( indicatorService.getIndicator( Integer.parseInt( memberId ) ) );
+            members.add( indicatorService.getIndicator( id ) );
         }
 
         if ( jsonAttributeValues != null )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm	2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataDictionaryForm.vm	2014-09-24 11:57:54 +0000
@@ -1,47 +1,19 @@
 <script type="text/javascript" src="javascript/addDataDictionaryForm.js"></script>
 <script type="text/javascript">
 	jQuery(function() {
-		jQuery("#availableDataElements").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
-			iterator: "dataElements",
-			connectedTo: 'selectedDataElements',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			},
-			filter: {
-				source: "../dhis-web-commons-ajax-json/getDataElementGroups.action",
-				label: 'dataelement group',
-				iterator: "dataElementGroups",
-				handler: function(item) {
-					return "<option data-key='id' data-value='" + item.id + "'>" + item.name + "</option>";
-				}
-			}
-		});
-
-		jQuery("#availableIndicators").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getIndicators.action",
-			iterator: "indicators",
-			connectedTo: 'selectedIndicators',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			},
-			filter: {
-				source: "../dhis-web-commons-ajax-json/getIndicatorGroups.action",
-				iterator: "indicatorGroups",
-				label: 'indicator group',
-				handler: function(item) {
-					return "<option data-key='id' data-value='" + item.id + "'>" + item.name + "</option>";
-				}
-			}
-		});
+        $('#deAvailable').selected({
+          url: '../api/dataElements.json',
+          target: $('#deSelected'),
+          search: $('#deAvailableSearch'),
+          iterator: 'dataElements'
+        });
+
+        $('#inAvailable').selected({
+          url: '../api/indicators.json',
+          target: $('#inSelected'),
+          search: $('#inAvailableSearch'),
+          iterator: 'indicators'
+        });
 	});
 </script>
 
@@ -75,63 +47,17 @@
 	</tr>
 </table>
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_data_elements" )</th>
-		<th></th>
-		<th>$i18n.getString( "selected_data_elements" )
-			<select id="memberValidator" style="display:none"/>
-		</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableDataElements" name="availableDataElements" multiple="multiple" style="height: 200px; width: 100%;"></select>
-		</td>
-
-        <td>
-        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableDataElements' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedDataElements' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElements' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedDataElements' );"/>
-		</td>			
-
-		<td>
-			<select id="selectedDataElements" name="selectedDataElements" multiple="multiple" style="height: 200px; width: 100%; margin-top: 45px;"></select>
-		</td>		
-	</tr>
-
-	<tr>		
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th></th>
-		<th>
-			$i18n.getString( "selected_indicators" )<select id="memberValidatorIn" style="display:none"/>
-		</th>
-	</tr>
-
-	<tr>	
-		<td>
-			<select id="availableIndicators" name="availableIndicators" multiple="multiple" style="height: 200px; width: 100%;"></select>
-		</td>
-
-        <td>
-        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicators' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedIndicators' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicators' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedIndicators' );"/>
-        </td>
-
-		<td>
-			<select id="selectedIndicators" name="selectedIndicators" multiple="multiple" style="height: 200px; width: 100%; margin-top: 45px;"></select>
-		</td>
-	</tr>
-</table>
+#jqSelected({
+  "prefix": "de",
+  "i18n_available": "available_data_elements",
+  "i18n_selected": "selected_data_elements"
+})
+
+#jqSelected({
+  "prefix": "in",
+  "i18n_available": "available_indicators",
+  "i18n_selected": "selected_indicators"
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupForm.vm	2014-03-25 08:18:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementGroupForm.vm	2014-09-24 11:57:54 +0000
@@ -6,6 +6,7 @@
             'beforeValidateHandler' : function () {
                 beforeSubmit();
                 #tblDynamicAttributesJavascript()
+                $("#deSelected").find("option").attr("selected", "selected");
             },
             'rules' : getValidationRules("dataElementGroup")
         });
@@ -13,19 +14,13 @@
         checkValueIsExist("name", "validateDataElementGroup.action");
 		checkValueIsExist( "shortName", "validateDataElementGroup.action" );
 	    checkValueIsExist( "code", "validateDataElementGroup.action" );
-		
-		jQuery("#availableDataElementsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
-			iterator: "dataElements",
-			connectedTo: 'groupMembers',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
 
-				return option;
-			}
-		});
+        $('#deAvailable').selected({
+          url: '../api/dataElements.json',
+          target: $('#deSelected'),
+          search: $('#deAvailableSearch'),
+          iterator: 'dataElements'
+        });
 	});
 </script>
 
@@ -56,36 +51,11 @@
 
 #tblDynamicAttributes( { "attributes": $attributes } )
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_data_elements" )</th>
-		<th></th>
-		<th>$i18n.getString( "group_members" )</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableDataElementsList" name="availableDataElementsList" 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="dhisAjaxSelect_moveAllSelected( 'availableDataElementsList' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElementsList' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
-		</td>
-
-		<td>
-			<select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;"></select>
-		</td>
-	</tr>
-</table>
+#jqSelected({
+  "prefix": "de",
+  "i18n_available": "available_data_elements",
+  "i18n_selected": "selected_data_elements"
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm	2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm	2014-09-24 11:57:54 +0000
@@ -8,6 +8,7 @@
             {
                 listValidator( 'memberValidator', 'groupMembers' );
                 #tblDynamicAttributesJavascript()
+                $("#inSelected").find("option").attr("selected", "selected");
             },
             'rules' : getValidationRules( "indicatorGroup" )
         } );
@@ -16,18 +17,12 @@
         nameField.select();
         nameField.focus();
 
-		jQuery("#availableIndicatorsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getIndicators.action",
-			iterator: "indicators",
-			connectedTo: 'groupMembers',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			}
-		});
+        $('#inAvailable').selected({
+          url: '../api/indicators.json',
+          target: $('#inSelected'),
+          search: $('#inAvailableSearch'),
+          iterator: 'indicators'
+        });
 	});
 </script>
 
@@ -52,37 +47,11 @@
 
 #tblDynamicAttributes( { "attributes": $attributes } )
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th></th>
-		<th>$i18n.getString( "group_members" )</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableIndicatorsList" 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="dhisAjaxSelect_moveAllSelected( 'availableIndicatorsList' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicatorsList' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
-        </td>
-    
-		<td>
-			<select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;"></select>
-		</td>
-		
-	</tr>
-</table>
+#jqSelected({
+  "prefix": "in",
+  "i18n_available": "available_indicators",
+  "i18n_selected": "selected_indicators"
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'add' )" style="width:10em"/>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js	2013-03-14 10:55:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addDataDictionaryForm.js	2014-09-24 11:57:54 +0000
@@ -1,8 +1,8 @@
 jQuery( document ).ready( function()
 {
     function preSubmit() {
-        var $selectedDataElements = $('#selectedDataElements');
-        var $selectedIndicators = $('#selectedIndicators');
+        var $selectedDataElements = $('#deSelected');
+        var $selectedIndicators = $('#inSelected');
 
         var hasDataElements = $selectedDataElements.val() != null && $selectedDataElements.val().length > 0;
         var hasIndicators = $selectedIndicators.val() != null && $selectedIndicators.val().length > 0;
@@ -22,8 +22,10 @@
     }, {
         'beforeValidateHandler' : function()
         {
-            listValidator( 'memberValidator', 'selectedDataElements' );
-            listValidator( 'memberValidatorIn', 'selectedIndicators' );
+            listValidator( 'deValidator', 'deSelected' );
+            listValidator( 'inValidator', 'inSelected' );
+            $("#deSelected").find("option").attr("selected", "selected");
+            $("#inSelected").find("option").attr("selected", "selected");
         },
         'rules' : getValidationRules( "dataDictionary" )
     } );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js	2012-11-25 22:18:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateDataDictionaryForm.js	2014-09-24 11:57:54 +0000
@@ -1,8 +1,8 @@
 jQuery( document ).ready( function()
 {
     function preSubmit() {
-        var $selectedDataElements = $('#selectedDataElements');
-        var $selectedIndicators = $('#selectedIndicators');
+        var $selectedDataElements = $('#deSelected');
+        var $selectedIndicators = $('#inSelected');
 
         var hasDataElements = $selectedDataElements.val() != null && $selectedDataElements.val().length > 0;
         var hasIndicators = $selectedIndicators.val() != null && $selectedIndicators.val().length > 0;
@@ -22,8 +22,10 @@
     }, {
         'beforeValidateHandler' : function()
         {
-            listValidator( 'memberValidator', 'selectedDataElements' );
-            listValidator( 'memberValidatorIn', 'selectedIndicators' );
+            listValidator( 'deValidator', 'deSelected' );
+            listValidator( 'inValidator', 'inSelected' );
+            $("#deSelected").find("option").attr("selected", "selected");
+            $("#inSelected").find("option").attr("selected", "selected");
         },
         'rules' : getValidationRules( "dataDictionary" )
     } );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm	2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataDictionaryForm.vm	2014-09-24 11:57:54 +0000
@@ -1,47 +1,19 @@
 <script type="text/javascript" src="javascript/updateDataDictionaryForm.js"></script>
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		jQuery("#availableDataElements").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
-			iterator: "dataElements",
-			connectedTo: 'selectedDataElements',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			},
-			filter: {
-				source: "../dhis-web-commons-ajax-json/getDataElementGroups.action",
-				label: 'dataelement group',
-				iterator: "dataElementGroups",
-				handler: function(item) {
-					return "<option data-key='id' data-value='" + item.id + "'>" + item.name + "</option>";
-				}
-			}
-		});
-
-		jQuery("#availableIndicators").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getIndicators.action",
-			iterator: "indicators",
-			connectedTo: 'selectedIndicators',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			},
-			filter: {
-				source: "../dhis-web-commons-ajax-json/getIndicatorGroups.action",
-				iterator: "indicatorGroups",
-				label: 'indicator group',
-				handler: function(item) {
-					return "<option data-key='id' data-value='" + item.id + "'>" + item.name + "</option>";
-				}
-			}
-		});
+        $('#deAvailable').selected({
+          url: '../api/dataElements.json',
+          target: $('#deSelected'),
+          search: $('#deAvailableSearch'),
+          iterator: 'dataElements'
+        });
+
+        $('#inAvailable').selected({
+          url: '../api/indicators.json',
+          target: $('#inSelected'),
+          search: $('#inAvailableSearch'),
+          iterator: 'indicators'
+        });
 
 		// checkValueIsExist( "name", "validateDataDictionary.action", {id: $dataDictionary.id});
 	});
@@ -76,71 +48,19 @@
 	</tr>
 </table>
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_data_elements" )</th>
-		<th></th>
-		<th>
-			$i18n.getString( "selected_data_elements" )<select id="memberValidator" style="display:none"/>
-		</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableDataElements" name="availableDataElements" multiple="multiple" style="height: 200px; width: 100%;"></select>
-		</td>
-
-        <td>
-        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableDataElements' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedDataElements' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElements' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedDataElements' );"/>
-		</td>			
-
-		<td>
-			<select id="selectedDataElements" name="selectedDataElements" multiple="multiple" style="height: 200px; width: 100%; margin-top: 45px;">
-				#foreach( $dataElement in $selectedDataElements )
-                    <option value="$dataElement.id">$encoder.htmlEncode( $dataElement.name )</option>
-                #end				
-			</select>
-		</td>		
-	</tr>
-
-	<tr>		
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th></th>
-		<th>
-			$i18n.getString( "selected_indicators" ) <select id="memberValidatorIn" style="display:none"/>
-		</th>
-	</tr>
-
-	<tr>	
-		<td>
-			<select id="availableIndicators" name="availableIndicators" multiple="multiple" style="height: 200px; width: 100%;"></select>
-		</td>	
-
-        <td>
-        	<input type="button" value="&gt;" title="$i18n.getString( 'move_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'availableIndicators' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'selectedIndicators' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicators' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'selectedIndicators' );"/>
-        </td>
-
-		<td>
-			<select id="selectedIndicators" name="selectedIndicators" multiple="multiple" style="height: 200px; width: 100%; margin-top: 45px;">
-				#foreach( $indicator in $selectedIndicators )
-                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.name )</option>
-                #end				
-			</select>
-		</td>
-	</tr>
-</table>
+#jqSelected({
+  "prefix": "de",
+  "i18n_available": "available_data_elements",
+  "i18n_selected": "selected_data_elements",
+  "objects": $dataDictionary.dataElements
+})
+
+#jqSelected({
+  "prefix": "in",
+  "i18n_available": "available_indicators",
+  "i18n_selected": "selected_indicators",
+  "objects": $dataDictionary.indicators
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'save' )" style="width:10em" />

=== 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	2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementGroupForm.vm	2014-09-24 11:57:54 +0000
@@ -7,6 +7,7 @@
             'beforeValidateHandler' : function() {
                 beforeSubmit();
                 #tblDynamicAttributesJavascript()
+                $("#deSelected").find("option").attr("selected", "selected");
             },
             'rules' : getValidationRules( "dataElementGroup" )
         } );
@@ -23,18 +24,12 @@
             id : getFieldValue( 'id' )
         } );
 
-		jQuery("#availableDataElementsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getDataElements.action",
-			iterator: "dataElements",
-			connectedTo: 'groupMembers',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			}
-		});
+        $('#deAvailable').selected({
+          url: '../api/dataElements.json',
+          target: $('#deSelected'),
+          search: $('#deAvailableSearch'),
+          iterator: 'dataElements'
+        });
 	});
 </script>
 
@@ -68,40 +63,12 @@
 
 #tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_data_elements" )</th>
-		<th></th>
-		<th>$i18n.getString( "group_members" )</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableDataElementsList" name="availableDataElementsList" 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="dhisAjaxSelect_moveAllSelected( 'availableDataElementsList' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableDataElementsList' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
-        </td>
-
-		<td>
-			<select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;">
-				#foreach( $dataElement in $groupMembers )
-					<option value="$dataElement.id">$encoder.htmlEncode( $dataElement.displayName )</option>
-				#end
-			</select>
-		</td>
-	</tr>
-</table>
+#jqSelected({
+    "prefix": "de",
+    "i18n_available": "available_data_elements",
+    "i18n_selected": "selected_data_elements",
+    "objects": $dataElements
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm	2013-07-19 08:23:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm	2014-09-24 11:57:54 +0000
@@ -8,22 +8,17 @@
             {
                 listValidator( 'memberValidator', 'groupMembers' );
                 #tblDynamicAttributesJavascript()
+                $("#inSelected").find("option").attr("selected", "selected");
             },
             'rules' : getValidationRules( "indicatorGroup" )
         } );
 
-		jQuery("#availableIndicatorsList").dhisAjaxSelect({
-			source: "../dhis-web-commons-ajax-json/getIndicators.action",
-			iterator: "indicators",
-			connectedTo: 'groupMembers',
-			handler: function(item) {
-				var option = jQuery("<option data-id='" + item.groups + "' />");
-				option.text( item.name );
-				option.attr( "value", item.id );
-
-				return option;
-			}
-		});
+        $('#inAvailable').selected({
+          url: '../api/indicators.json',
+          target: $('#inSelected'),
+          search: $('#inAvailableSearch'),
+          iterator: 'indicators'
+        });
 
 		// checkValueIsExist( "name", "validateIndicatorGroup.action", {id: $indicatorGroup.id});
 	});
@@ -51,41 +46,12 @@
 
 #tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
 
-<table>
-    <colgroup>
-      <col style="width: 500px;"/>
-      <col/>
-      <col style="width: 500px;"/>
-    </colgroup>
-
-	<tr>
-		<th>$i18n.getString( "available_indicators" )</th>
-		<th></th>
-		<th>$i18n.getString( "group_members" )</th>
-	</tr>
-
-	<tr>
-		<td>
-			<select id="availableIndicatorsList" 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="dhisAjaxSelect_moveAllSelected( 'availableIndicatorsList' );"/><br/>
-            <input type="button" value="&lt;" title="$i18n.getString( 'remove_selected' )" style="width:50px" onclick="dhisAjaxSelect_moveAllSelected( 'groupMembers' );"/><br/>
-			<input type="button" value="&gt;&gt;" title="$i18n.getString('move_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'availableIndicatorsList' );"/><br/>
-			<input type="button" value="&lt;&lt;" title="$i18n.getString('remove_all')" style="width:50px" onclick="dhisAjaxSelect_moveAll( 'groupMembers' );"/>
-        </td>
-    
-		<td>
-			<select id="groupMembers" name="groupMembers" multiple="multiple" style="height: 200px; width: 100%; margin-top: 22px;">
-				#foreach( $indicator in $groupMembers )
-                    <option value="$indicator.id">$encoder.htmlEncode( $indicator.displayName )</option>
-                #end
-			</select>
-		</td>
-		
-	</tr>
-</table>
+#jqSelected({
+    "prefix": "in",
+    "i18n_available": "available_indicators",
+    "i18n_selected": "selected_indicators",
+    "objects": $indicators
+})
 
 <p>
 	<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>