rtf

Stores the rich text value for rich text fields.

Syntax

   <rtf>rich text</rtf>
Table 1. rtf parameter
Parameter Type Description
rich text string The rich text string.

Available in

field

Example

This sample shows a rich text field:

   <field sid="richTextField">
      <texttype>text/rtf</texttype>
      <value>Hello</value>
      <rtf>rich text version of Hello</rtf>
   </field>

Usage details

  1. Default: if the rtf option is empty or does not exist, a default rich text string is created as follows:
    • Text: set to equal the value option.
    • Font: set as the fontinfo and fontcolor options.
    • Justification: set as the justify option.

      If the required options are not present, then the default settings for those options are used. Note that the background color is controlled by the bgcolor option, not the rich text.

  2. To use rich text in a field, the texttype option must be set to text/rtf.
  3. A plain text version of the rich text string is stored in the value option, with the following considerations:
    • If the value option has a compute, that compute is lost when the text is copied from the rtf option. (However, external changes to the value are still made. For example, a set.)
    • Once the text is copied to the value option, the format system may impose a change based on the format option. If a change occurs, then the rtf option is reset based on the formatted value option and the fontinfo, fontcolor, justify, and bgcolor options.
    • If the plain text version does not match the rich text, then the rich text takes precedence. In this case, the value option is updated to reflect the rich text.
  4. Computed changes to the fontinfo, fontcolor, bgcolor, justify, texttype, or value options will cause the rtf option to update if necessary.
  5. Changes to the rtf option do not cause changes to the fontinfo, fontcolor, bgcolor, or justify options.
  6. Dynamically changing the texttype from rtf to plain text is not supported.
  7. When using XForms, the rtf option is bound to the data model (as opposed to the value option).