-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I would like to put some part of Listitem label in italic <i>, bold <strong> or <sup> for instance
Example:
1s item
2d item
...
Listitem don't allow child elements. Is there a way / workaround to put some HTML code directly inside the Listitem label ? I know I could develop a custom solution with a text field and a Grid to simulate what I need, but I would like to know if I am missing something simplier. Is it possible to prevent HTML escaping when setting Listitem label for instance, just like setContent for Comboitem? Comboitem is not an alternative to me since I need checkboxes (checkmark="true")
Thank you very much in advance.
Benoit
i think a custom renderer does fit your need.
@Override public void render(Listitem item, Object data) throws Exception { MyBean obj = (MyBean) data; Listcell lc; . . . lc = new Listcell(); Html html = new Html("This is italic"); html.setStyle("font-style:italic; font-size: 11px; padding-left: 5px;"); Div div = new Div(); div.setAlign("left"); div.appendChild(html); div.setParent(lc); lc.setParent(item); item.setValue(data); . . .
best
Stephan
You can also refer this example here
Asked: 2012-10-16 17:49:17 +0800
Seen: 108 times
Last updated: Oct 25 '12