Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java @ 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 | 5533aa8f8b73 |
comparison
equal
deleted
inserted
replaced
7616:9fc549a7f5cb | 7617:89c1fcd6db52 |
---|---|
156 f.setType(ListGridFieldType.FLOAT); | 156 f.setType(ListGridFieldType.FLOAT); |
157 } | 157 } |
158 catch (NumberFormatException nfe) { | 158 catch (NumberFormatException nfe) { |
159 f.setType(ListGridFieldType.TEXT); | 159 f.setType(ListGridFieldType.TEXT); |
160 } | 160 } |
161 | |
162 // TODO Numerical sorting still does not work if the first values are empty (then | |
163 // it defaults to TEXT, currently. Shall be fixed. | |
164 | |
161 // To keep server-side formatting and i18n also of | 165 // To keep server-side formatting and i18n also of |
162 // float values, we will store the value once formatted 'as is' | 166 // float values, we will store the value once formatted 'as is' |
163 // to be displayed and once as e.g. float to allow functions like | 167 // to be displayed and once as e.g. float to allow functions like |
164 // sorting on it. | 168 // sorting on it. |
165 displayField[i] = i + "_displayField"; | 169 displayField[i] = i + "_displayField"; |
179 r.setAttribute(displayField[j], sItem[j]); | 183 r.setAttribute(displayField[j], sItem[j]); |
180 if (fields[j].getType() == ListGridFieldType.TEXT) { | 184 if (fields[j].getType() == ListGridFieldType.TEXT) { |
181 r.setAttribute(String.valueOf(j), sItem[j]); | 185 r.setAttribute(String.valueOf(j), sItem[j]); |
182 } | 186 } |
183 else { | 187 else { |
184 r.setAttribute(String.valueOf(j), nf.parse(sItem[j])); | 188 try { |
189 r.setAttribute(String.valueOf(j), nf.parse(sItem[j])); | |
190 } | |
191 catch (NumberFormatException nfe) { | |
192 r.setAttribute(String.valueOf(j), sItem[j]); | |
193 } | |
185 } | 194 } |
186 } | 195 } |
187 dataTable.addData(r); | 196 dataTable.addData(r); |
188 } | 197 } |
189 } | 198 } |