Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/TableDataPanel.java @ 9314:49c0b687d22f
Fixed: some texts, such as "<MNQ", not visible in pdf export and in result table.
author | gernotbelger |
---|---|
date | Thu, 26 Jul 2018 16:31:35 +0200 |
parents | f1be005f0c46 |
children | 0452f1c1bad3 |
comparison
equal
deleted
inserted
replaced
9313:6ffcbb4f35d5 | 9314:49c0b687d22f |
---|---|
18 import org.dive4elements.river.client.client.services.CSVExportServiceAsync; | 18 import org.dive4elements.river.client.client.services.CSVExportServiceAsync; |
19 import org.dive4elements.river.client.shared.model.DataList; | 19 import org.dive4elements.river.client.shared.model.DataList; |
20 | 20 |
21 import com.google.gwt.core.client.GWT; | 21 import com.google.gwt.core.client.GWT; |
22 import com.google.gwt.i18n.client.NumberFormat; | 22 import com.google.gwt.i18n.client.NumberFormat; |
23 import com.google.gwt.safehtml.shared.SafeHtmlUtils; | |
23 import com.google.gwt.user.client.rpc.AsyncCallback; | 24 import com.google.gwt.user.client.rpc.AsyncCallback; |
24 import com.smartgwt.client.data.Record; | 25 import com.smartgwt.client.data.Record; |
25 import com.smartgwt.client.types.ListGridFieldType; | 26 import com.smartgwt.client.types.ListGridFieldType; |
26 import com.smartgwt.client.util.SC; | 27 import com.smartgwt.client.util.SC; |
27 import com.smartgwt.client.widgets.Canvas; | 28 import com.smartgwt.client.widgets.Canvas; |
207 final String[] sItem = list.get(i); | 208 final String[] sItem = list.get(i); |
208 final Record r = new Record(); | 209 final Record r = new Record(); |
209 for (int j = 0; j < sItem.length; j++) { | 210 for (int j = 0; j < sItem.length; j++) { |
210 // See above, display 'as is' from server, but keep value | 211 // See above, display 'as is' from server, but keep value |
211 // in machine-usable way (float), to allow numeric sorting. | 212 // in machine-usable way (float), to allow numeric sorting. |
212 r.setAttribute(displayField[j], sItem[j]); | 213 String item = sItem[j]; |
213 // r.setAttribute(String.valueOf(j), sItem[j]); | 214 String encodedText = SafeHtmlUtils.htmlEscapeAllowEntities(item); |
215 | |
216 r.setAttribute(displayField[j], encodedText); | |
214 if (fields[j].getType() == ListGridFieldType.TEXT) { | 217 if (fields[j].getType() == ListGridFieldType.TEXT) { |
215 r.setAttribute(String.valueOf(j), sItem[j]); | 218 r.setAttribute(String.valueOf(j), item); |
216 } else { | 219 } else { |
217 try { | 220 try { |
218 final Float valueFloatSortable = (float) nf.parse(sItem[j]); | 221 final Float valueFloatSortable = (float) nf.parse(item); |
219 r.setAttribute(String.valueOf(j), valueFloatSortable); | 222 r.setAttribute(String.valueOf(j), valueFloatSortable); |
220 } | 223 } |
221 catch (final NumberFormatException nfe) { | 224 catch (final NumberFormatException nfe) { |
222 r.setAttribute(String.valueOf(j), sItem[j]); | 225 r.setAttribute(String.valueOf(j), item); |
223 } | 226 } |
224 } | 227 } |
225 | 228 |
226 } | 229 } |
227 | 230 |