Source code editor
Overview
Form Builder usage

Configuration
XForms usage
Element name and binding
Styling
Last updated
The source code editor component uses the excellent CodeMirror library.
Form Builder uses this component to edit the source of a form.

You can change the default theme used by the editor by setting the following property:
For Form Builder, the following values are supported:
solarized dark: dark theme, used by default by Form Builder with 2025.1, 2024.1
default: a light theme
The name of the XBL element name is <fr:code-mirror>. You bind it to the node that contains the text to view or edit, just like you would with an <xf:textarea>. If the node you bind it to is readonly, then users will be able to view the source but not edit it.
The theme attribute allows you to specify the theme to use for the editor. The value of this attribute takes precedence over the oxf.xforms.xbl.fr.code-mirror.theme property.
By default, the editor takes 100% of the available width, and has a fixed height of 300 pixels. You can set to use a width and height of your choosing with CSS, as follows:
Last updated
<property
as="xs:string"
name="oxf.xforms.xbl.fr.code-mirror.theme"
value="solarized dark"/>.xbl-fr-code-mirror .CodeMirror {
height: 20em;
width: 50em;
}