← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11728: support optionSets in forms

 

------------------------------------------------------------
revno: 11728
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-08-21 12:23:07 +0200
message:
  support optionSets in forms
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/Field.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-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java	2013-08-21 07:28:04 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java	2013-08-21 10:23:07 +0000
@@ -202,6 +202,11 @@
                     field.setCategoryOptionCombo( categoryOptionCombo.getUid() );
                     field.setType( inputTypeFromDataElement( dataElement ) );
 
+                    if ( dataElement.getOptionSet() != null )
+                    {
+                        field.setOptionSet( dataElement.getOptionSet().getUid() );
+                    }
+
                     fields.add( field );
                 }
             }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/Field.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/Field.java	2012-10-15 10:20:17 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/Field.java	2013-08-21 10:23:07 +0000
@@ -44,6 +44,8 @@
 
     private InputType type;
 
+    private String optionSet;
+
     public Field()
     {
     }
@@ -102,4 +104,15 @@
     {
         this.type = type;
     }
+
+    @JsonProperty
+    public String getOptionSet()
+    {
+        return optionSet;
+    }
+
+    public void setOptionSet( String optionSet )
+    {
+        this.optionSet = optionSet;
+    }
 }