Support > Repository > Screen function > Screen transition (2) Transit from detail screen to search screen
ja | en

Transit from detailed screen to search screen of arbitrary model. Pass parameters at the same time.

Figure 1 shows an example of preparing buttons to transition from the detailed screen of the estimate model to the search screen of the customer model. Here, the value of "company name" is reused as a search condition.

Figure 1 Example of preparing a button to move to the search screen of customer model

When this button is pushed, the search process of the customer model is performed with the company name given as the search condition. In FIG. 2,Search and list are put together on the same screen.

Figure 2 Search & list screen of customer model

In the "estimate model" shown in Figure 1, open "Screen> Other> Set Java source code".
Here, define the add button as follows.

item Description Input example
screen name Specify which screen to add a button to.Here we will define "Detailed display screen". Detailed display screen
indicate Enable it. (check)
Display condition When displaying buttons always, this column is blank.For conditions, see "Button display conditionPlease read.
Button name Specify an arbitrary name.It can also be expressed as an expression. Search by this company
event name Specify the event for the transitioned screen.[To be described later] Reset
Action name Specify the screen to transition.[To be described later] showListCustomer
Additional parameters Parameters can be specified on the transition screen.[To be described later] companyname=${companyname}
Figure 3 Setting the add button

event name

For each screen, events that can be received are prepared.The events that can be accepted on the search screen are as follows.

event name Description
Reset Resets the current search condition and performs search processing using external parameters.It is effective when passing parameters from outside like this time.
Search Use the search condition that was set first.For this reason, the second and subsequent external parameters are not set.This is a screen transition that goes back and forth between the search screen and the list display screen and is an event to hold search conditions.
Search_Condition It is the same as Search, but if there is no parameter, it is treated as an empty search condition was specified.
Event names are case sensitive.Please input correctly.

Action name

A string consisting of a combination of model and screen.It becomes part of address bar (URL).

The search and list display screen is as follows.

"ShowList" + model name (Camel notation)

With this rule, the action name corresponding to the search list display screen of the model "customer" is "showListCustomer". Extension is not required.

Camel notation: Capitalize the first letter.Remove the underscore included in the model name and capitalize the next letter.For example my_funny_valentine would be MyFunnyValentine.

Additional parameters

Search conditions can be passed directly to the search screen.

The format is "key = value".The key part is the item ID (of the transition destination model).
Using placeholders ($ {...}) in the value part,Transition sourceYou can pass in the value of the item.

To pass multiple parameters, separate them with &.

Additional parameters for realizing the operation in Figure 2 are as follows.The left side of Equal is an item of the customer model, this time it becomes search condition.The right side of the equal is an item of the estimate model.

companyname=${companyname}

Initial value setting of receiving side (search condition)

For this item of the receiving side model (customer model in this example), set the REQUEST function to "When initial value> search screen is displayed".

Fig. 4 Initial value of search condition

Restriction

The following can not be specified for the item name described in the additional parameter.

  • Repeat item
  • Repeating container item
  • A foreign key child model tied to this model

In the examples of Figs. 1 and 2, the "company name" in the customer model was a character string type. Next is an example of dividing "company model" and "customer model".The "company name" of the customer model changes to a structure holding the primary key of the company model.(FIG. 5, FIG. 6)

Figure 5 Definition of company model
Figure 6 Modified customer model

Execution

"Company name" in the estimate is model reference (from string type) - reference linked - -.At this time, if you click "Search by this company" button, we will pass the company name code (ID part).

Figure 7 Detailed screen of revised quotation model

For model reference, you can also check that the parameters are crossed.(FIG. 8)

Figure 8 Customer search screen after pressing the button

Configuration

Quotation model

"Company name" in the estimation model is reference interlocking.In the case of reference linkage, standard content is passed as standard, but this time it is required to pass "ID part" as argument.(This is because the "company name" of the customer model is model reference.)

Therefore, we modify the "additional parameter" of the estimate model shown in Fig. 3 as follows.You can pass ID by giving "#id".

#idDetailed notation is "calculation formula>Model referencePlease read.

companyname=${companyname#id}
Figure 9 Correction of additional parameters

Customer model

In order to set the code (ID part) as the initial value of the search condition,TOINTApply the function.

TOINT(REQUEST())
Fig. 10 Changing the expression of the initial value (application of the TOINT function)

"Screen transition (1) Transit from detail screen to registration screen> Specifications/ConstraintsPlease read.