Support > Repository > Initial value > Checkbox
ja | en

Several special designation methods are available for setting initial values ​​to check boxes.

If you specify "ALL" as the initial value, it will be in the "selected all" state.(Please leave "Type" field blank.)

Fig. 1 Specify "ALL" as the initial value.
Figure 2 Example of execution

This setting has the following restrictions.

  • Can not be combined with automatic calculation formula.Only "ALL" is specified.
  • If the primary key of the referenced model is a date type, this specification can not be made.
  • The narrowing setting is ignored.(All are selected.)

If you specify "belonging group" as the initial value type, you can set the group to which the user belongs to the checked state.

Here is an example of preparing the item "group" in the model.

item name
(Japanese)
item name
(English)
Type Reference model Contents of reference model
group itemgroup Reference to other store models
(Checkbox)
jgroup jgroupname
Figure 3 Definition of "Group" Item

The initial value of the same item is set to "belonging group" at the time of new registration and display of the search screen.

Fig. 4 Define the initial value as "belonging group".

Figure 5 shows an example of the display of the search condition part when logging on with an account belonging to the group "General Affairs Department". You can see that the group you belong to is checked.

Figure 5 Only belonging groups are checked

When applying the function to the initial value, please set "initial value type" to "arithmetic operation".(If you omit the initial value type, you can not use the function.)

When using a functionReturns array valueIt is necessary.(Since the check box holds multiple values, internally it handles data in an array format.) So even if you return a single value ARRAY_INT functionPlease enclose with.

Example: Change initial value depending on authority.

Fig. 6 Configuration example

IF (HASMODELPERMISSION ("sinsei", "modelA"), ARRAY_INT (1, 2, 3, 4), ARRAY_INT (1))

To initial value REQUEST function, You can embed values ​​in URL parameters.
By specifying as follows, you can set all check boxes to be selected.

http://localhost:8921/wagby/insertTest.do?checkboxitem=ALL&action_New=
It does not correspond to the designation that several items are selected state. In the next specification, only the first "10" is checked.
http://localhost:8921/wagby/insertTest.do?item=10&item=30&item=50&action_New=