[PATCH 2 of 9] Avoid certain exception, added todo about issues with implementation
Wald Commits
scm-commit at wald.intevation.org
Mon Dec 2 10:14:51 CET 2013
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1385718581 -3600
# Node ID 89c1fcd6db525048c88c0e9c91d0a942d4a9b697
# Parent 9fc549a7f5cb200ac87da3df34466bcfa4dcee6b
Avoid certain exception, added todo about issues with implementation.
diff -r 9fc549a7f5cb -r 89c1fcd6db52 gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java
--- 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);
More information about the Dive4elements-commits
mailing list