dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12614
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3923: completed filter by key for data elements operands (ajax-json)
------------------------------------------------------------
revno: 3923
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-06-16 14:49:19 +0200
message:
completed filter by key for data elements operands (ajax-json)
modified:
dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementOperandsAction.java
--
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/src/main/java/org/hisp/dhis/commons/action/GetDataElementOperandsAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementOperandsAction.java 2011-05-16 14:21:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetDataElementOperandsAction.java 2011-06-16 12:49:19 +0000
@@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.hisp.dhis.dataelement.DataElementCategoryService;
@@ -115,6 +116,21 @@
operands = new ArrayList<DataElementOperand>();
}
+ if ( key != null )
+ {
+ Iterator<DataElementOperand> iterator = operands.iterator();
+
+ while ( iterator.hasNext() )
+ {
+ DataElementOperand operand = iterator.next();
+
+ if ( operand.getOperandName().toLowerCase().indexOf( key.toLowerCase() ) == -1 )
+ {
+ iterator.remove();
+ }
+ }
+ }
+
Collections.sort( operands, new DataElementOperandNameComparator() );
if ( usePaging )