Support > Repository > Input control > Input control by value of other items
ja | en

When an item reaches the value set, it makes it possible to enter the corresponding item or disallow input.

When the status is "trouble", we will explain an example where you can enter the "cause" item. Assume that the status master is prepared as shown in Fig. 1.

Figure 1 Setting the status master

In the initial state of the report new registration screen, you can not enter the "cause" item.

Figure 2 Cause items can not be entered

If you select "Trouble" for status, you can enter "cause" item.

Figure 3 It is possible to enter the cause item

Definition method

Figure 4 shows a "report" model that realizes the above sample application.

Figure 4 Definition of report model

Opens the detailed definition dialog for the "cause" item. Write an expression in the form of "item name = value" in "Enable input/No control> Allow input depending on the value of other items".

status=2
Fig. 5 Setting to enable input according to the value of other items

When specifying multiple values

Specify multiple values ​​for one itemIn case, specify "," (comma) separator.In the example below the priority is 1 Or It means 2 case.

status=1,status=2

Allow input when value is entered in other item

If a value is entered for an item, you can describe the condition that it is.When the name of another item is status,

status=

will do.Since there is no value specification, the condition is satisfied when there is an input value.

Handling of existing data at change

In the above example, "cause" is described at the time of new registrationrear, "Status" as "trouble" Other thanYou change it to.At this time, there are two methods of how to deal with "cause" already entered.

Choicebehavior
Overwrite with blank (standard)When input becomes impossible, erase the input value (overwrite it with blank).
(Item values ​​that have already been entered are kept on the screen but are not sent to the server.Therefore, the input value is erased.)
Retain valueEven if it becomes impossible to enter, the value already entered will be retained.
Input enable/disable control is realized by switching the disabled attribute of the input item to true or false depending on conditions. If the disabled attribute of the input item is true, the input field is grayed out and no value is sent to the server even if there is an input value.This is HTML specification.

You can select this setting change as shown in Figure 6.When not set it becomes "Overwrite with blank".

Figure 6 Specify handling of existing data at change

Combination with required designation

You can define control that enables input as combined with mandatory check. It becomes a mandatory input item when it becomes "input possible".

Supplement: Expression of "Status ID" item

In the above example, the item "Status ID" is inherently unnecessary.ID values ​​are prepared for visual inspection. This item is of numerical type (to store ID), and the following expression is applied.

${status#id}

For details on how to write expressions, see "Calculation formula> Model referencePlease read.

It is also possible to specify that input is disabled when conditions are met. Figure 7 shows an example of disabling input when the status is "1".

Figure 7 Input of cause item becomes impossible

Definition method

Describe the conditional expression (item name = value) in the column of "Enable input/No control> Input disable depending on the value of other items".

Fig. 8 Setting to disable input depending on the value of other items

Undefined types

  • Repeat item
  • Repeat containers (Includes IDs for repeating containers and items in repeating containers)
  • Write-once type list boxWhen used
  • Date type (list boxIs used)

Types that can not be defined as "other items"

  • The above four patterns of "undefined type"
  • File type
  • Model reference (search screen)

Writing conditional expressions

  • The expression accepts only the form "item name = value".Function can not be described.In the model reference item, specify the ID part.(In the above example, it means not using the word "trouble" but using the ID "2".)
  • Multiple items can not be described in conditional expressions.For example, you can not specify gender = 1, status = 2.

You can not specify both at the same time

You can not specify both "Can be entered depending on the value of other items" or "Can not enter depending on the value of another item" at the same time.

Handling read-only items

"Input control by value of other items" will work only when the initial screen of the screen is displayed even if "other item" is a read-only item.However, even if the value of the read-only item changes after display (depending on the formula etc.) the input enable/disable status will not change.

This function uses JavaScript change or blur event which occurs when the value of "other item" is changed.Since these events do not occur in the read-only field, it is impossible to change the input enable/disable status when the value is changed.

You can avoid this constraint by creating a dummy hidden item and posting the value of the read-only item to the hidden item and then controlling it.