Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
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.

...