Checkbox

The checkbox switches between two values (equal to the button switch) and can be used as input or output control only (see parameter "editable").

It can be used in the following modes:

  1. only "base" is specified:

    In this case additionally the "on value", "value On to be set" and "value Off to be set" have to be set (NOTE: “on value” must be equal to “value On to be set”) With this configuration, on each click, the checkbox switches between 2 values for the address "base". It will be in On state if the value of the "base" equals the "value On"; otherwise it will be Off.

  2. "base" and "address to set" are specified:

    With this configuration, on each click, the following happens:

    • The checkbox will be in On state if the value of the "base" equals the "value On"; otherwise it will be Off.

    • Depending whether the checkbox is On of Off, on click "address to set" will be set to "value Off to be set" or to "value On to be set".

    • The checkbox itself will change the state (ticked or not) only when the "base" is changed (feedback channel).

  3. neither "base" nor “address to set” are specified:

    In this case, the trigger "valuechanged" with the value from "value Off to be set" or "value On to be set" will be fired. These triggers can be used to add a Simple Dynamic to this checkbox which reacts on the triggers and fires a new trigger. This new trigger can then be used by other elements.

An additional border indicates the current value's negative state or an additionally defined alarm. The colors and blinking intervals are defined in global lists.

Triggers

Following triggers can be used for this object display:

  • com.atvise.setActive – Can be used to enable or disable the object display.

  • setChecked – The object display connects to this trigger. Therefore, it is possible to enable or disable the checkbox.

  • valuechanged – Fired on value changes, e.g. by user input.

//Disable the object display
webMI.trigger.fire("com.atvise.setActive", false, "myDisplayID");

//Enable checkbox
webMI.trigger.fire("setChecked", true, "myDisplayID");

//Respond to value changes
webMI.trigger.connect("valuechanged", function(e) { console.log(e.value); }, "myDisplayID");

Hint

Additional undocumented triggers are internally used by atvise. Their functionality may be changed in future atvise releases.

Parameters

This control has the following generic parameters:

  • base – Depending whether or not "address to set" is specified, the behavior is according to mode 1 and 2 above

  • alarm address – Optional additional address of an alarm to be shown.

  • label – Label of the checkbox (default: T{Checkbox})

  • on value – Value which defines when the checkbox is ticked

  • value on to be set – Depending on the configuration, "base" or "address to set" will be set to this value when switching from Off state to On state

  • value off to be set – Depending on the configuration, "base" or "address to set" will be set to this value when switching from On state to Off state

  • enable status monitoring – Switch monitoring of current value status on or off. (default: Yes)

  • fire status trigger – Instead of the status display a here defined trigger can be fired globally.

Font:

  • family – Font family which will be applied to value (default: Arial)

  • size – Font size which will be applied to the value (default: 12)

  • color – Color which will be applied to the value (default: global parameter atvFontColor (advanced), #000000 (standard))

Appearance:

  • preselect this checkbox – If set to "true", the checkbox will be ticked on load; otherwise not. This takes only effect if no "base" and no "address to set" are specified. (default: false)

  • fill color – Fill color of background areas (default: global parameter atvFillColor (advanced), #d0d0d0 (standard))

  • Advanced checkarea fill color – Fill color of the checkarea (default: #ffffff)

  • fill color not editable – Fill color if checkbox is not editable (default: #f4f4f4 (advanced), #ffffff (standard)))

  • fill color when inactive – Fill color if not active (default: global parameter atvInactiveColor (advanced), #8c8c8c (standard))

  • symbol – Symbol which is shown if checkbox is ticked; further symbols can be selected from "Object Displays (ATVISE)/Symbols/20x20 (default: x2)

  • symbol color – Color of the symbol to be used (default: global parameter atvSymbolColor (advanced), #000000 (standard))

  • stroke color pressed – The color of the stroke which will be set when the checkbox is clicked (default: #ffffff)

  • focus stroke color – The color of the stroke which will be set when the button is focused (default: #ffffff)

  • Advanced border color – Color of the border around the object display (default: global parameter atvBorderColor)

  • status indication – Specify the status' display through a defined global list (default: global parameter atvStatusIndication)

  • alarm indication – Specify the alarm's display through a defined global list (default: global parameter atvAlarmIndication)

Options:

  • address to set – The behavior is according to mode 2 above

  • editable – If set to "Yes", the checkbox can also be used as input field, i.e. the checkbox can be ticked. If set to "No" it can only be used as output field. (default: Yes)

  • consistency group – Name of the consistency group

  • tab index – Defines the order for changing between the object displays by using the tab key

  • tooltip – Displays a tooltip box with the entered text (standard HTML-Elements can be entered)

Security:

  • necessary right – The user must have this right to activate the checkbox i.e. to tick the checkbox

  • activation address – If the value of this address equals to "activation value", then the checkbox will be active, i.e. can be pressed

  • activation value – Value which activates the checkbox

    Hint

    The activation of the checkbox can be configured only by the necessary right, or only by the activation address and value or by both. In case both settings are made, the user must have the necessary right and the value of the "activation address" must equal the "activation value"; otherwise the checkbox will not be activated.

  • show access control notification – Defines if the icon for showing access control notifications shall be displayed (default: true)

Menu:

  • menu positioning – The position the menu symbol is shown at (top-left, top-right, bottom-left, bottom-right).

  • menu mouseover active – Symbol is only shown on mouseover.

  • menu symbol offset x – Relative offset of the menu symbol to the anchor point on the x axis in pixel.

  • menu symbol offset y – Relative offset of the menu symbol to the anchor point on the y axis in pixel.

  • context menu click frame – Defines the size of the click frame for opening the context menu.

Example

For mode 2 as described above assume the following parameters:

  • base: node_feedback

  • on value: 1

  • value On to be set: 1

  • value Off to be set: 0

  • address to set: node_set

Furthermore assume that the values of "base" and "address to set" are set to 0.

  1. With these setting the checkbox will not be ticked.

  2. On click, "node_set" will be set to 1 (= "value On to be set"); the checkbox is still not ticked (value of "base" is still different from "on value")

  3. As soon as "base" is set to 1 (feedback channel from PLC), the checkbox will now be ticked (value of "base" is now equal to "on value")

  4. On click, "node_set" will be set to 0 (= "value Off to be set"); the checkbox will still be ticked (value of "base" is still equal to "on value")

  5. As soon as "base" is set to 0 (feedback channel from PLC), the checkbox will no longer be ticked (value of "base" is now different from "on value")