# Statements editor

For components **Statements** and **Statements at the layer** a specialized editor is available. It allows statements to be defined using the JSON format.

## Editor location

The statement editor is available in the **Basic properties** components **Statements** and **Statements at the layer**.

<div data-with-frame="true"><img src="/files/c6176855144d07dd6a4ad8b2ec7d370f8cf2dd8c" alt=""></div>

<p align="center"><em><strong>Figure 1.</strong> Location where the statement editor is embedded</em></p>

The editor is opened by clicking **Add statement**.

## Editor presentation

Opening the statement editor causes a drawer to slide out, presenting an area for entering text in JSON format. For a newly created component, it contains only curly braces without content. Line numbers are visible on the left side of the editor.

The statement editor can be displayed in read-only mode and in edit mode. Read-only mode allows only viewing of saved values.

<div data-with-frame="true"><img src="/files/a90be0e08767892afd89726538f970209b667c25" alt="Figure 2. Appearance of the statement editor for a newly created component"></div>

The editor highlights both semantic and syntax errors in real time. When you hover the mouse over a red underline indicating an error, a tooltip displaying its content is shown.

<div data-with-frame="true"><img src="/files/79397fc3a4149080adf20d5989d580dddd35fe23" alt="Figure 3. Example information about required fields"></div>

## Editor operation

The statement editor supports syntax hinting functionality. After pressing the key combination **Ctrl + Space** a hint is displayed containing fields that can be entered depending on the current cursor position in the editor. Selecting one of them and pressing **Enter** inserts the selected hint into the editor.

<div data-with-frame="true"><img src="/files/c6475f41dd98827c0e09175345e513ed2045f67a" alt="Figure 4. Hints displayed after pressing the Ctrl + Space key combination"></div>

The editor can be closed in two ways. The first is the symbol **X** located in the upper-right corner (visible in Figure 2). The second way is to click outside the editor area.

{% hint style="info" %}
If, when closing the editor, the entered data are semantically and syntactically correct, they are saved. If they contain any error, the changes are discarded. In both cases, the drawer closes.
{% endhint %}

## Available fields

The statement editor accepts the fields listed below. Their meaning will be explained in the next paragraph. Required fields are additionally marked:

{% code title="Example JSON structure" expandable="true" %}

```json
{
  "items": [
    {
      "controls": [
        {
          "mid": "text",                 // required
          "titleKey": "text",           // required
          "type": "CHECKBOX|RADIO",      // possible values CHECKBOX or RADIO, required
          "visibleCondition": "text",
          "styleName": "text",
          "requiredCondition": "text",
          "notSelectedErrorTextKey": "text",
          "requiredNotAcceptedErrorTextKey": "text",
          "mastercheckbox": "text"
        }
        // ...
      ],
      "actionBindings": {
        "bindings": [
          {
            "event": "EDIT"             // possible value EDIT, required
          }
          // ...
        ]
      },
      "mid": "text",                   // required
      "textContent": "text",
      "textContentUnexpanded": "text",
      "visibleCondition": "text",
      "expandableCondition": "text",
      "expandedCondition": "text",
      "descriptionKey": "text",
      "nativePopupTitleKey": "text",
      "styleName": "text"
    }
    // ...
  ]
}
```

{% endcode %}

### Meaning of fields

| Property                  | Description                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **items**                 | A list of defined statements to be displayed.                                                                                                                                                                                                                                                                                               |
| **textContent**           | An artifact containing the statement content displayed below the title given in **titleKey**. If the artifact is specified and the key **titleKey** and a control defined in **controls**are not provided, then the textContent content will not contain a control.                                                                         |
| **textContentUnexpanded** | An artifact containing the statement content displayed when the statement is collapsed.                                                                                                                                                                                                                                                     |
| **mid**                   | Business identifier of the given statement.                                                                                                                                                                                                                                                                                                 |
| **visibleCondition**      | Conditions under which the given statement is to be displayed. If the condition is empty or invalid, the value "true" will be evaluated.                                                                                                                                                                                                    |
| **styleName**             | Style name.                                                                                                                                                                                                                                                                                                                                 |
| **expandableCondition**   | The condition for which text to collapse/expand the statement content should be displayed next to the statement title. If the condition is empty or invalid, the value "false" will be evaluated. Note: if **titleKey** is undefined, the text will not appear.                                                                             |
| **expandedCondition**     | If **expandableCondition** is set to "true", the property **expandedCondition** determines whether and when the statement content should be expanded by default. If the condition is empty or invalid, the value "true" will be evaluated (content expanded).                                                                               |
| **titleKey**              | Title key of a single statement defined in the **Translations**tab. Variables are resolved in the keys.                                                                                                                                                                                                                                     |
| **nativePopupTitleKey**   | Title key of the native popup that will be displayed when clicking "More" → this text can be overridden by i18n.statements.item.native.more in the **Translations**tab. The popup is displayed only in the native application. If **nativePopupTitleKey** is not defined, the value of the key will be displayed as the title **titleKey**. |
| **event**                 | The event to add if an action on the application related to a given statement item has been defined.                                                                                                                                                                                                                                        |
| **controls**              | A list of defined controls for a given statement. An explanation of the object fields **controls** is below.                                                                                                                                                                                                                                |

### **Defining the list of controls (controls)**

| Property                            | Description                                                                                                                                         |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **mid**                             | Business identifier of the control (required field).                                                                                                |
| **titleKey**                        | Title key displayed next to/above the control.                                                                                                      |
| **visibleCondition**                | Conditions under which the control is to be displayed. If the condition is empty or invalid, the value "true" will be evaluated.                    |
| **requiredCondition**               | The condition for which the control is required. If the condition is empty or invalid, the value "true" will be evaluated.                          |
| **type**                            | Control type: **RADIO** - a statement with two YES/NO radio buttons (other types such as CHECKBOX may also occur according to the JSON definition). |
| **notSelectedErrorTextKey**         | Translation key overriding the text "You have not made a selection".                                                                                |
| **requiredNotAcceptedErrorTextKey** | Translation key overriding the text "Consent to the selected statement is required".                                                                |
| **styleName**                       | Style name.                                                                                                                                         |
| **mastercheckbox**                  | Master checkbox ID.                                                                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/7-komponenty-specjalne/oswiadczenia-statements/edytor-oswiadczen.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
