Page History
...
Code Block | ||
---|---|---|
| ||
public boolean returnsHtml() { return true; } public String render(Object value, int renderType) throws Exception { if (value == null) return null; if (renderType == RENDER_LINK) { return value.toString(); } else if (renderType == RENDER_HTML) { return "<b>" + value.toString() + "</b>"; } else { // rendering to non-html output return value.toString(); } } |
See Appendix B Click here for a full example of a custom formatter that takes a numeric value, and formats it as a currency value.
...