X4 Produktdokumentation

Checkbox

With <Checkbox> controls, you can map simple yes/no decisions or multiple selections to forms. Users can activate individual options or make multiple selections at the same time. In addition, <Checkbox> controls can be used to control the visibility or activation of other form fields or to trigger certain process paths in the workflow.

Instructions for use

A <Checkbox> control is created with the <Checkbox> element.

<Checkbox>
...
</Checkbox>

<Checkbox> controls can be used in all available layout types: For more information, see Layouts.

Attribute

Note:

There are a number of default attributes that can be set for all controls. For more information about the default attributes, see Default attributes.

In addition to the default attributes, you can define the following attributes for <Checkbox> controls:

Attribute

Description

checked

Required

Specifies whether the checkbox is enabled or disabled by default.

  • Data binding (Boolean) is possible

Note:

The use of data binding for the status of the checkbox is necessary for the checkbox to function properly and to save the initial value of result or set.

Possible values:

  • true / false

  • String for data binding

displayName

Label. Is displayed next to the checkbox.

  • Data binding possible

Possible values:

Any string

sliderOnDesktop

Specifies whether the checkbox is displayed as a slider in the desktop version.

Possible values:

true / false

Note:

Checkboxes are displayed differently in the desktop version and in the mobile version.

  • Display in the desktop version: image-20260216-145311.png

  • Display in mobile version: image-20260216-145326.png

The sliderOnDesktop attribute can also be used to view the mobile version display in the desktop version.

Actions

The following action is available for <Checkbox> controls. For more information about actions, see Actions.

<SelectAction>

You can insert the Select action using the <SelectAction/> element within <Checkbox>. The action is triggered as soon as the user activates or deactivates the checkbox.

Note:

You must insert the <SelectAction> element before the desired layout type (BoxLayout, FlowLayout, GridLayout, ResponsiveLayout, TabLayout).

Example

Checkbox control in the Detail Component
XML
<DetailComponent>
    <FlowLayout horizontalAlign="left">
        <Checkbox checked="#checkNews" displayName="Subscribe to newsletter" fontSize="large"/>
        <Checkbox checked="true" displayName="I accept the privacy policy" textOverflow="allow" foreground="A700" fontSize="large"/>
    </FlowLayout>
</DetailComponent>
image-20251107-074208.png