# HG changeset patch # User Sebastian Kruse # Date 1357820442 -3600 # Node ID ea856995abac475a26ece5f7c28209a2554f3b69 # Parent 8b58d9bc0bb66f9091ef4caa47794e06968c073c Allow HTML in Description field diff -r 8b58d9bc0bb6 -r ea856995abac src/econnect/wp3_3/client/widgets/table/DynamicStiTable.java --- a/src/econnect/wp3_3/client/widgets/table/DynamicStiTable.java Thu Jan 03 18:43:28 2013 +0100 +++ b/src/econnect/wp3_3/client/widgets/table/DynamicStiTable.java Thu Jan 10 13:20:42 2013 +0100 @@ -4,7 +4,10 @@ import java.util.Comparator; import java.util.List; +import com.google.gwt.safehtml.shared.SafeHtml; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; import com.google.gwt.user.cellview.client.CellTable; +import com.google.gwt.user.cellview.client.Column; import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; import com.google.gwt.user.cellview.client.SimplePager; import com.google.gwt.user.cellview.client.TextColumn; @@ -24,6 +27,7 @@ import com.google.gwt.view.client.ListDataProvider; import com.google.gwt.view.client.Range; import com.google.gwt.view.client.RangeChangeEvent; +import com.google.gwt.cell.client.SafeHtmlCell; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.dom.client.NodeList; @@ -295,10 +299,14 @@ placeColumn.setSortable(true); this.elementsTable.addColumn(placeColumn, "Place"); - TextColumn descriptionColumn = new TextColumn() { + SafeHtmlCell descriptionCell = new SafeHtmlCell(); + + Column descriptionColumn = new Column(descriptionCell) { @Override - public String getValue(DataObject object) { - return object.getDescription(); + public SafeHtml getValue(DataObject object) { + SafeHtmlBuilder sb = new SafeHtmlBuilder(); + sb.appendHtmlConstant(object.getDescription()); + return sb.toSafeHtml(); } }; descriptionColumn.setSortable(true);