1. Outline
Time-consuming processes such as downloading and displaying large amounts of image data can be executed in separate threads using asynchronous processing, allowing another process to be executed in the meantime rather than waiting for the process to finish.
The sample project used in the explanation can be downloaded from the following link. We hope you will take advantage of it.
2. Operation image
<If not asynchronous processing (synchronous processing)
<For asynchronous processing
3. Implementation method (explanation of key points only)
3-1. Screen Creation
Create a new screen and place the necessary controls.
Create three screens: a "main" screen, a "sub form" that loads images, and a "sub form list" used to display lists within the sub form.
*Please see below for a list of sub-forms.
Repeatedly display sub-screens
3-1-1. Main
(1) Button
Controls that perform asynchronous processing.
3-2. Logic implementation
3-2-1. Asynchronous processing execution
This process is executed with the "① button" on the main screen. Moves to the sub form and executes the image loading logic. As shown below, there is only one line of difference between synchronous and asynchronous processing.
<Synchronous processing
<Asynchronous processing
Each process is compared in detail.
<Synchronous processing | <Asynchronous processing |
---|---|
Thus, by setting "asynchronous processing execution" of "control statement" for the component and "new thread" for the thread, asynchronous processing execution as shown in the operation image can be realized.
3-3. Logic calls from the screen
Set "3-2-1. Execute Asynchronous Processing" as "Execute Process" in "① Button" on the main screen.
This completes the implementation.