← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10370: [mobile] limit the optionset return to j2me client

 

------------------------------------------------------------
revno: 10370
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Thu 2013-03-21 14:12:02 +0700
message:
  [mobile] limit the optionset return to j2me client
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.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-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java	2013-03-13 09:57:42 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java	2013-03-21 07:12:02 +0000
@@ -47,7 +47,11 @@
         de.setType( dataElement.getType() );
 
         de.setCategoryOptionCombos( getCategoryOptionCombos( dataElement ) );
-        de.setOptionSet( getOptionSet( dataElement ) );
+        
+        //Limit the optionset transfer to the client
+        if (dataElement.getOptionSet() != null && dataElement.getOptionSet().getOptions().size() <= 50) {
+            de.setOptionSet( getOptionSet( dataElement ) );
+        }
         return de;
     }