-
25 Sep 2012 9:44 AM #1
Possible Bug with SummaryRenderer?
Possible Bug with SummaryRenderer?
I currently have a SummaryColumnConfig defined as:
This summary column is displaying the HTML as a string. After stepping through the code with Eclipse, it appears the HTML is being escaped on line 163 of the GroupSummaryView class viaCode:SummaryColumnConfig<CompareData, BigDecimal> changeCol = new SummaryColumnConfig<CompareData, BigDecimal>(compareDataAccess.change(), 100, "Change"); changeCol.setMenuDisabled(true); changeCol.setAlignment(HasHorizontalAlignment.ALIGN_RIGHT); changeCol.setCell(new AbstractCell<BigDecimal>() { @Override public void render(Context context, BigDecimal value, SafeHtmlBuilder sb) { String style = "style='color: " + (value.compareTo(Constants.ZERO) < 0 ? "red" : value.compareTo(Constants.ZERO) > 0 ? "green" : "black") + "'"; sb.appendHtmlConstant("<span " + style + ">" + NumberFormat.getFormat("###.00 %").format(value.doubleValue()) + "</span>"); } }); changeCol.setSummaryType(new SummaryType.SumSummaryType<BigDecimal>()); changeCol.setSummaryRenderer(new SummaryRenderer<CompareData>() { @Override public SafeHtml render(Number value, Map<ValueProvider<? super CompareData, ?>, Number> data) { String style = "style='color: " + (value.doubleValue() < 0 ? "red" : value.doubleValue() > 0 ? "green" : "black") + "'"; return SafeHtmlUtils.fromTrustedString("<span " + style + ">" + NumberFormat.getFormat("###.00 %").format(value.doubleValue()) + "</span>"); } });Note: The changeCol cells appear correctly in the grid, while the summary column does not.Code:SafeHtmlUtils.fromString(value)
-
25 Sep 2012 9:27 PM #2
Yah that should be corrected. I will move this thread to the bugs forum so we can take a look at it. Thanks for bringing it up
-
5 Feb 2013 8:26 AM #3
This does not appear to have been fixed yet. It seems like a straighforward issue - when will it be resolved ?
-
5 Feb 2013 12:11 PM #4
This has been fixed in SVN and will be available in the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTGWT-2807
in
3.0.4.


Reply With Quote