Many business applications handle "item" information. Here, the item "refers to a certain group of data contained in the model.The item is strongly associated with the data (which stores it), and when you delete the data, the item data contained in it is deleted at the same time.
Here, we show an example of preparing a new model "business daily report" and handling the detailed information in the form of "visit history" in it. This visit history information can be described multiple times in one business daily report. Wagby defines such detail information as an item of "repeating container" type.
Prepare a new model "dailyreport".
We will make model name (Japanese) "business daily report".The model items are as follows.
|Item name (Japanese)||Item name (English)||Item type||Primary key|
|Business daily report ID||dailyreportid||Integer type||○|
|Person in charge||staff||Character type|
|Visit history||visit||Container of repetitive items|
|number||visit/vid||ID for repeated item container|
|client||visit/vcustomer||Item reference of another model (search screen)|
For the items included in the repeating container, the item name (English) is "repeating container name +"/"+ item name".
The beginning of the repeating container defines the "ID for the repeated item container" to indicate the number (order) of that container.
Leave the type of the "customer" item initially as a string type.(Figure 1)
When the setting is over, change the type to "reference item of another model".(Figure 2)
In the visit history, it is necessary to store the visit information "which customer visited".In this case, it is desirable to refer to already registered "customer" models.
By the way, it is expected that hundreds to tens of thousands of "customer" models will be operated.In such a case, we will use "(Search window using subwindow)" provided by Wagby.
Open the detail definition window for the item visit/vcustomer that stores the customer.
The input type is "search screen".
Specify the referenced model and referenced model item (which item value in the referenced model is displayed).
Follow the previous steps to build.
After building, start the Wagby application and log on.
Select "Import and export" from the management processing menu.
Now restore the previous data.Specify the data saved in the previous tutorial as "import folder name".
Click the "select all" button and press the "Import" button with all models as the target.
A new "business daily report" has been added to the "Service" tab of the menu.
Open the new registration screen.
You can input date items by data picker function.
A button called "Search ..." is prepared for the "customer" item in the repeat container "visit history".
When you press the search button, a subwindow like the one in Figure 8 opens.The search conditions on this screen are those specified by the search condition of the customer model.
When you click the "To list display" button in Figure 9, the search results as shown in Figure 10 are displayed. "Customer name" is displayed in link format.You can search by pressing the target data (customer name).
Figure 11 shows an example of repeating this operation and creating two visit histories.
To clear the customer information you entered, press the eraser icon provided on the left of the entry field.(FIGS. 12 and 13)
Finally, I will explain how to change the position of the defined model item. Here we change the model definition so that the "date" item is part of the visit history.
I will return to WagbyDesigner.Drag the "date" item of the business daily report model with the mouse and drop it at the position where you want to insert it.(FIG. 17, FIG. 18)
Change the item ID (English name).We will fit into the naming convention to enter the repeating container.Here we have "date" as "visit/vdate".I added "v" before date and changed it to vdate.
As before, I stop, build, and restart the Web application.
Figure 20 shows the new registration screen after correction.Since the date item entered in the visit history, it is possible to make multiple inputs.
Before proceeding to the next step, save the current data. Select "Import and export" from the management processing menu.Please select the target model "select all" and "export".
Log off from the application.Proceed to the next tutorial.