changeset 7617:89c1fcd6db52

Avoid certain exception, added todo about issues with implementation.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 29 Nov 2013 10:49:41 +0100
parents 9fc549a7f5cb
children 9098499114e9
files gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java	Thu Nov 28 12:04:18 2013 +0100
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java	Fri Nov 29 10:49:41 2013 +0100
@@ -158,6 +158,10 @@
             catch (NumberFormatException nfe) {
                 f.setType(ListGridFieldType.TEXT);
             }
+
+            // TODO Numerical sorting still does not work if the first values are empty (then
+            // it defaults to TEXT, currently. Shall be fixed.
+
             // To keep server-side formatting and i18n also of
             // float values, we will store the value once formatted 'as is'
             // to be displayed and once as e.g. float to allow functions like
@@ -181,7 +185,12 @@
                     r.setAttribute(String.valueOf(j), sItem[j]);
                 }
                 else {
-                    r.setAttribute(String.valueOf(j), nf.parse(sItem[j]));
+                    try {
+                        r.setAttribute(String.valueOf(j), nf.parse(sItem[j]));
+                    }
+                    catch (NumberFormatException nfe) {
+                        r.setAttribute(String.valueOf(j), sItem[j]);
+                    }
                 }
             }
             dataTable.addData(r);

http://dive4elements.wald.intevation.org