Skip to content

Commit

Permalink
Update snippets and check box documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkvanMents committed Sep 16, 2019
1 parent 7f9a990 commit 02ddb9d
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 76 deletions.
2 changes: 1 addition & 1 deletion _assets/mappings/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ module.exports = {
},
{
from: "/refguide8/drop-down-widget",
to: "/refguide/drop_down"
to: "/refguide/drop-down"
},
{
from: "/refguide8/horizontal-split-pane",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 43 additions & 23 deletions content/refguide/check-box.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,76 @@ tags: ["studio pro"]
#If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details.
---

## 1 Introduction

A check box is an [input widget](input-widgets) that can be used to display and edit Boolean attributes. It will display a tick if the value is true and remain empty if it is false.
A **check box** is used to display and, optionally, allow the end-user to edit the value of an attribute of [data type](data-types) *Boolean*. It displays a tick if the value is true and remain empty if it is false.

{{% alert type="info" %}}In native mobile applications, the check box widget is rendered as a toggle.{{% /alert %}}

{{% alert type="info" %}}
For example, this check box allows you to see, and set, whether someone is subscribed to your newsletter.

![](attachments/pages/check-box.png)
![](attachments/check-box/check-box.png)

This check box allows you to change whether someone is subscribed to the newsletter.
## 2 Properties

{{% /alert %}}
An example of check box properties is represented in the image below:

## Data source properties
{{% image_container width="250" %}}![](attachments/check-box/check-box-properties.png)
{{% /image_container %}}

Check box properties consist of the following sections:

* [Common](#common)
* [Data source](#data-source)
* [Design Properties](#design-properties)
* [Editability](#editability)
* [Events](#events)
* [Label](#label)
* [Visibility](#visibility)

### 2.1 Common Section{#common}

{{% snippet file="refguide/common-section-link.md" %}}

### 2.2 Data Source Section{#data-source}

{{% snippet file="refguide/attribute-path-property.md" %}}

{{% snippet file="refguide/label-property.md" %}}
### 2.3 Design Properties Section{#design-properties}

## Editability properties
### 2.4 Editability Section{#editability}

{{% snippet file="refguide/editable-property.md" %}}
{{% snippet file="refguide/editability-section-link.md" %}}

{{% snippet file="refguide/read-only-style.md" %}}
### 2.5 Events Section{#events}

{{% snippet file="refguide/condition-property.md" %}}
#### 2.5.1 On Change

## Visibility properties
The on-change property specifies an action that will be executed when leaving the widget, either by using the <kbd>Tab</kbd> key or by clicking another widget, after the value has been changed.

{{% snippet file="refguide/visibility-property.md" %}}
{{% snippet file="refguide/events-section-link.md" %}}

{{% snippet file="refguide/visibility-property-with-module-roles-simple.md" %}}
#### 2.5.2 On Enter

## Events properties
The on-enter property specifies an action that will be executed when the widget is entered, either by using the <kbd>Tab</kbd> key or by clicking it with the mouse.

{{% snippet file="refguide/on-change-event.md" %}}
{{% snippet file="refguide/events-section-link.md" %}}

{{% snippet file="refguide/on-enter-event.md" %}}
#### 2.5.3 On Leave

{{% snippet file="refguide/on-leave-event.md" %}}
The on-leave property specifies an action that will be executed when leaving the widget, either by using the <kbd>Tab</kbd> key or by clicking another widget.

## Common properties
This differs from the [On change](#on-change) property in that the event will always be triggered, even if the value has not been changed.

{{% snippet file="refguide/name-property.md" %}}
{{% snippet file="refguide/events-section-link.md" %}}

{{% snippet file="refguide/class-property.md" %}}
### 2.6 Label Section{#label}

{{% snippet file="refguide/label-property.md" %}}

{{% snippet file="refguide/style-property.md" %}}
### 2.7 Visibility Section{#visibility}

{{% snippet file="refguide/tab-index-property.md" %}}
{{% snippet file="refguide/visibility-section-link.md" %}}

## Related articles

Expand Down
32 changes: 29 additions & 3 deletions content/refguide/common-widget-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ In Mendix 8.1 and above, you can edit attributes presented in input widgets over

By default, whether or not an element is displayed in the browser is determined by how the page is designed and the user's roles within the application. However, the page can be configured to hide the element unless a certain condition is met.

{{% todo %}}[Investigate the difference between DEFAULT and ALWAYS - If a widget is inside an invisible widget, you cannot make it display by choosing ALWAYS?]{{% /todo %}}

#### 5.1.1 Context

The widget can be made visible only if the object of the data view that contains the widget satisfies the specified criteria.
Expand All @@ -111,7 +113,7 @@ Note that the expression is evaluated in the browser, and hence, we advise again

The widget can be made visible to a subset of the user roles available in your application. When activated, this setting will render the widget invisible to all users that are not linked to one of the selected user roles.

## 6 Editability Section
## 6 Editability Section{#editability}

### 6.1 Editable

Expand All @@ -127,6 +129,30 @@ The editable property indicates whether the end user will be able to change the

### 6.2 Condition

A widget can be made editable based on the value of an attribute of the enclosing data view. The attribute must be of type Boolean or enumeration. For each value, you specify whether the widget is editable. Upon opening the page and upon changing the condition attribute the edit state of the widget will be updated.
The widget can be made editable only if the object of the data view that contains the widget satisfies the specified criteria.

For example, imagine you are creating a personal details form in which the end-user must enter their marital status. In this case, you might wish to disable the input of a marriage date until the end-user indicates that they are married.

#### 6.2.1 Based on Attribute Value

When selected, this enables the widget while a particular attribute has a certain value. Only Boolean and enumeration attributes can be used for this purpose.

#### 6.2.2 Based on Expression

When selected, this enables the widget while a provided [expression](expressions) evaluates to true. The object of the containing data view is available inside an expression as a `$currentObject` variable.

Note that the expression is evaluated in the browser, and hence, we advise against using "secret" values (like access keys) in it. In particular, we disallow usages of [constants](constants). Also, client-side expressions currently do not support all the functions that are available in the microflows. Please refer to an autocomplete list to know what functions are supported in your version.

### 6.2.3 Read-Only Style

This property determines how the widget is rendered if it is read-only.

| Value | Description |
|-----------------------------|-------------|
| Based on data view | Set to `Control` or `Text` by the containing data view. *(Default value for widgets inside a data view)*
| Not enclosed by a data view | Defaults to `Text`. *(Default value for widgets outside a data view)*
| Inherited from snippet call | Set to `Control` or `Text` by the containing data view of the snippet call, or `Text` when the snippet call is not enclosed by a data view. *(Default value for widgets outside a data view inside a snippet)*
| Control | Widget is displayed but disabled so the value cannot be modified.
| Text | Widget is replaced by a textual representation of the value.

Example: you do not have to ask for the marriage date if the end-user indicates that he or she is not married.
{{% alert type="info" %}}Read-only style is not supported on native mobile pages.{{% /alert %}}
24 changes: 17 additions & 7 deletions content/refguide/drop_down.md → content/refguide/drop-down.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,29 @@ Text box properties consist of the following sections:

### 2.4 Editability Section{#editability}

{{% snippet file="refguide/editable-property.md" %}}
{{% snippet file="refguide/editability-section-link.md" %}}

{{% snippet file="refguide/read-only-style.md" %}}
### 2.5 Events Section{#events}

{{% snippet file="refguide/condition-property.md" %}}
#### 2.5.1 On Change

### 2.5 Events Section{#events}
The on-change property specifies an action that will be executed when leaving the widget, either by using the <kbd>Tab</kbd> key or by clicking another widget, after the value has been changed.

{{% snippet file="refguide/events-section-link.md" %}}

#### 2.5.2 On Enter

The on-enter property specifies an action that will be executed when the widget is entered, either by using the <kbd>Tab</kbd> key or by clicking it with the mouse.

{{% snippet file="refguide/events-section-link.md" %}}

#### 2.5.3 On Leave

{{% snippet file="refguide/on-change-event.md" %}}
The on-leave property specifies an action that will be executed when leaving the widget, either by using the <kbd>Tab</kbd> key or by clicking another widget.

{{% snippet file="refguide/on-enter-event.md" %}}
This differs from the [On change](#on-change) property in that the event will always be triggered, even if the value has not been changed.

{{% snippet file="refguide/on-leave-event.md" %}}
{{% snippet file="refguide/events-section-link.md" %}}

### 2.6 General Section{#general}

Expand Down
2 changes: 1 addition & 1 deletion content/refguide/input-widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ There are several different input widgets, these are used for different [data ty

![Text area containing notes attribute](attachments/input-widgets/text-area.png)

* [**Drop Down**](drop_down) – shows the current value of and, optionally, allows users to pick an option from, a list of options in an *enumeration* attribute:
* [**Drop Down**](drop-down) – shows the current value of and, optionally, allows users to pick an option from, a list of options in an *enumeration* attribute:

![Drop down containing region attribute](attachments/input-widgets/drop-down.png)

Expand Down
Loading

0 comments on commit 02ddb9d

Please sign in to comment.