← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12480: Merge of SISMA-338. Fixes issue with download of data set report

 

Merge authors:
  Leandro Soares (lssoares)
Related merge proposals:
  https://code.launchpad.net/~sis-ma/dhis2/SISMA-338/+merge/189306
  proposed by: Leandro Soares (lssoares)
------------------------------------------------------------
revno: 12480 [merge]
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 17:18:24 +0200
message:
  Merge of SISMA-338. Fixes issue with download of data set report
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.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-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java	2013-10-07 15:18:24 +0000
@@ -82,6 +82,8 @@
 import org.htmlparser.filters.OrFilter;
 import org.htmlparser.filters.TagNameFilter;
 import org.htmlparser.nodes.TagNode;
+import org.htmlparser.tags.CompositeTag;
+import org.htmlparser.tags.Span;
 import org.htmlparser.tags.TableRow;
 import org.htmlparser.tags.TableTag;
 import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -568,11 +570,27 @@
     }
     
     /**
-     * Retrieves the value of a table cell.
+     * Retrieves the value of a table cell. Appends the text of child nodes of
+     * the cell. In case of composite tags like span or div the inner text is
+     * appended.
      */
     public static String getValue( TagNode cell )
     {
-        return cell.getFirstChild() != null ? cell.getFirstChild().getText().trim().replaceAll( "&nbsp;", EMPTY ) : EMPTY;
+        String value = EMPTY;
+
+        for ( Node child : cell.getChildren().toNodeArray() )
+        {
+            if ( child instanceof CompositeTag )
+            {
+                value += ((CompositeTag) child).getStringText();
+            }
+            else
+            {
+                value = value + child.getText();
+            }
+        }
+        
+        return value.trim().replaceAll( "&nbsp;", EMPTY );
     }
     
     // -------------------------------------------------------------------------