Skip to content
Snippets Groups Projects
Commit 924e1f1d authored by buczekp's avatar buczekp
Browse files

[LMS-1952] escape values displayed in combo box list & tooltip

SVN: 20655
parent 82a5c55d
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,9 @@ public class ListColumnFilterWidget<T> extends ComboBox<ModelData> implements
{
private static final int FILTER_APPLICATION_TIMEOUT_MS = 500;
private final static String MODEL_DISPLAY_KEY = "key";
private final static String MODEL_DISPLAY_KEY = "unescaped_value";
private final static String MODEL_ESCAPED_DISPLAY_KEY = "escaped_value";
private final static String MODEL_VALUE_KEY = "value";
......@@ -96,7 +98,8 @@ public class ListColumnFilterWidget<T> extends ComboBox<ModelData> implements
String label = filteredField.getHeader();
setEmptyText(label);
setToolTip(label);
setTemplate(GWTUtils.getTooltipTemplate(MODEL_VALUE_KEY, ModelDataPropertyNames.TOOLTIP));
setTemplate(GWTUtils.getTooltipTemplate(MODEL_ESCAPED_DISPLAY_KEY,
ModelDataPropertyNames.TOOLTIP));
GWTUtils.setupAutoWidth(this);
}
......@@ -151,10 +154,13 @@ public class ListColumnFilterWidget<T> extends ComboBox<ModelData> implements
{
displayValue = EMPTY_VALUE;
}
displayValue = StringEscapeUtils.unescapeHtml(displayValue);
model.set(MODEL_DISPLAY_KEY, displayValue);
displayValue = StringEscapeUtils.escapeHtml(displayValue);
model.set(MODEL_ESCAPED_DISPLAY_KEY, displayValue);
// WORKAROUND to have consistent value displayed in combo box field, list & tooltip
// (no idea why tooltip has to be escaped twice)
model.set(ModelDataPropertyNames.TOOLTIP, StringEscapeUtils.escapeHtml(displayValue));
model.set(MODEL_VALUE_KEY, value);
model.set(ModelDataPropertyNames.TOOLTIP, StringEscapeUtils.escapeHtml(value));
models.add(model);
}
return models;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment