I want to put a FlexTable into a CellTable, so in my String getValue() I created the FlexTable and returned ft.toString(), where ft is my FlexTable.
However, When I do table.addColumn(flex_table_string, "Header"), GWT does not render the HTML but rather leaves it as text
Please Help,
Thanks,
Mat
You should build a
Cell
that constructs the HTML table using theSafeHtmlBuilder
rather than building a widget and getting its HTML representation (BTW, you shouldn't even usetoString()
to do that, but rather create, say, aSimplePanel
, put the widget in it and then callgetElement().getInnerHTML()
on the parent panel).There are two main reasons:
SafeHtmlBuilder
will be faster (that's the whole point ofCellTable
vs.Grid
orFlexTable
)That being said, what you're asking is indeed possible: use a
Cell
that uses theSafeHtmlBuilder
'sappendHtmlConstant
method. Either make one, or, unlike the escape/unescape roundtrip suggested by Alex, use aTextCell
but construct it with a customSafeHtmlRenderer
(extendAbstractSafehtmlRenderer
for simplicity) that usesSafeHtmlUtils.fromTrustedString
.