Component tokenList, property "captionAsHtml" does it work?

When I use the following code :

<tokenList id="preferencesList"
  caption="Preferred <b>contact method:</b>"
  captionAsHtml="true"
  clearEnabled="false"
  inline="true"
  dataContainer="patientDc"
  position="BOTTOM"
  property="preferences"
  width="100%">
      <lookup optionsContainer="allPreferencesDc"/>
</tokenList>

I received the following error : “tokenList …must not contain the ‘<’ character”
Why is this so ? I thought once I specify captionAsHtml=“true”, I am allowed to use HTML code in caption attribute ?
I am also having problem with contextHelpText attribute in the same way after specifying contextHelpTextHtmlEnabled="true"

Hi,

You certainly can use HTML content in caption and context help. The error that you get relates to XML, that requires some reserved characters to be escaped, e.g.: <b>HTML</b> must be replaced with &lt;b&gt;HTML&lt;/b&gt;. I would recommend several options:

  • Escape HTML text, e.g. using either some online tool or IDEA plugin.
  • Set HTML text in Java controller (see live demo)
  • Define HTML text in message.properties (demo)

Regards,
Gleb

Thank you Gleb.
I understand