Skip to content

Code Box

CodeBox edits the inner text of its bound XPath with the code editor. Mode selects editor language support: JavaScript (default), XQuery, Html, or StyleSheet. Size is retained as an editor-size option; the current form renderer uses an automatic editor height.

Definitions and Arguments

Definitions supplies editor definitions for code assistance. Arguments and Name identify the code block for the feature that consumes it; the editor does not itself execute the entered code.

The widget is read-only when disabled and synchronizes editor changes to the bound node. Editing JavaScript, XQuery, HTML, or stylesheets in a form does not by itself grant permission to run the code; execution, validation, and authorization belong to the consuming feature.

XML Fields

  • XPath identifies the element that stores the edited code.
  • Name identifies this code block to the feature that consumes it. Mode selects JavaScript, XQuery, Html, or StyleSheet editing support.
  • Definitions/Definition supplies zero or more names used for code assistance. Arguments/Argument supplies the parameters expected by the consumer of the code block.
  • Size selects the editor-size option; the current form renderer uses an automatic editor height. RequiredForGroup, PlaceHolder, Hints, and Rules have the same roles as in other text-input widgets: validation grouping, empty-state prompt, user guidance, and conditional form behavior.

The editor persists only text at XPath; Definitions, Arguments, and Name describe how another configured feature should interpret that text.

Example

1
2
3
4
5
6
7
8
9
<CodeBox XPath="Script" Name="Validation" Mode="JavaScript" Size="Medium" RequiredForGroup="">
    <PlaceHolder><![CDATA[]]></PlaceHolder>
    <Definitions>
        <Definition>forms</Definition>
    </Definitions>
    <Arguments />
    <Hints><![CDATA[]]></Hints>
    <Rules />
</CodeBox>