← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13970: Fixed bug - Don't save attribute values in Tracked entity instance dashboard.

 

------------------------------------------------------------
revno: 13970
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-02-10 14:10:01 +0700
message:
  Fixed bug - Don't save attribute values in Tracked entity instance dashboard.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java	2014-02-10 05:42:16 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java	2014-02-10 07:10:01 +0000
@@ -171,8 +171,7 @@
         String value = null;
 
         Collection<TrackedEntityAttribute> attributes = attributeService.getAllTrackedEntityAttributes();
-        entityInstance.getAttributeValues().clear();
-
+        
         TrackedEntityAttributeValue attributeValue = null;
 
         if ( attributes != null && attributes.size() > 0 )
@@ -180,7 +179,8 @@
             for ( TrackedEntityAttribute attribute : attributes )
             {
                 value = request.getParameter( AddTrackedEntityInstanceAction.PREFIX_ATTRIBUTE + attribute.getId() );
-                
+ System.out.println("\n\n\n ====== \n value : " + value );
+ System.out.println("\n params : " + AddTrackedEntityInstanceAction.PREFIX_ATTRIBUTE + attribute.getId() );
                 attributeValue = attributeValueService.getTrackedEntityAttributeValue( entityInstance, attribute );
                 
                 if ( StringUtils.isNotBlank( value ) )
@@ -197,13 +197,18 @@
                             value = format
                                 .formatDate( TrackedEntityAttribute.getDateFromAge( Integer.parseInt( value ) ) );
                         }
+ System.out.println("\n\n attribute.getValueType() : " + attribute.getValueType() );
 
                         if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
                         {
                             TrackedEntityAttributeOption option = attributeOptionService
                                 .get( Integer.parseInt( value ) );
+
+                            System.out.println("\n\n option : " + option );
+                            
                             if ( option != null )
-                            {
+                            {  System.out.println("\n\n option : " + option );
+                            
                                 attributeValue.setAttributeOption( option );
                                 attributeValue.setValue( option.getName() );
                             }