Overview of the GWC-JS interface / Quick Start: Tour of GWC-JS interface |
The Genero Web Client for JavaScript (GWC-JS) provides a mechanism for applications to be run as child programs that execute in the background, that is the parent program can continue to run without waiting for the child program to finish.
The example BDL program (Navigation.42m) starts an application with stacked windows. It gives you the option to use a RUN WITHOUT WAITING command to start another instance of the application as a background process.
# Property of Four Js* # (c) Copyright Four Js 1995, 2015. All Rights Reserved. # * Trademark of Four Js Development Tools Europe Ltd # in the United States and elsewhere # # Four Js and its suppliers do not warrant or guarantee that these # samples are accurate and suitable for your purposes. Their inclusion is # purely for information purposes only. MAIN DEFINE cw STRING DEFINE i INT IF num_args() = 0 THEN LET i=1 ELSE LET i=arg_val(1) END IF OPEN FORM f FROM "Navigation" DISPLAY FORM f DISPLAY "screen" TO fname OPEN WINDOW w1 WITH FORM "Navigation" CALL fgl_setTitle("Window w1 - " || i) DISPLAY "w1" TO fname OPEN WINDOW w2 WITH FORM "Navigation" CALL fgl_setTitle("Window w2 - " || i) DISPLAY "w2" TO fname OPEN WINDOW w3 WITH FORM "Navigation" CALL fgl_setTitle("Window w3 - " || i) DISPLAY "w3" TO fname WHILE 1 DISPLAY "YES" TO info MENU "Test" COMMAND "w1" LET cw="w1" EXIT MENU COMMAND "w2" LET cw="w2" EXIT MENU COMMAND "w3" LET cw="w3" EXIT MENU COMMAND "screen" LET cw="screen" EXIT MENU COMMAND "RWW" RUN "fglrun Navigation " || i+1 WITHOUT WAITING COMMAND KEY(INTERRUPT) "Exit" EXIT PROGRAM END MENU DISPLAY "NO" TO info CASE cw WHEN "w1" CURRENT WINDOW IS w1 WHEN "w2" CURRENT WINDOW IS w2 WHEN "w3" CURRENT WINDOW IS w3 OTHERWISE CURRENT WINDOW IS SCREEN END CASE DISPLAY "YES" TO info END WHILE END MAIN
COMMAND "RWW" RUN "fglrun Navigation " || i+1 WITHOUT WAITING
# Property of Four Js* # (c) Copyright Four Js 1995, 2015. All Rights Reserved. # * Trademark of Four Js Development Tools Europe Ltd # in the United States and elsewhere # # Four Js and its suppliers do not warrant or guarantee that these # samples are accurate and suitable for your purposes. Their inclusion is # purely for information purposes only. LAYOUT GROUP(text="Test Current Window") GRID { Window name [fw ] Is current [info ] } END END ATTRIBUTES LABEL fw=formonly.fname; EDIT info=formonly.info; END
fglcomp Navigation.4gl
fglform Navigation.perCompiled files are created for the source code module and the form:
Navigation.42m.
Navigation.42f
<?xml version="1.0" encoding="UTF-8" ?> <APPLICATION Parent="defaultgwc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.4js.com/ns/gas/3.00/cfextwa.xsd"> <EXECUTION> <PATH><path_to_your_local_directory></PATH> <MODULE>Navigation.42m</MODULE> </EXECUTION> <UA_OUTPUT> <GWC-JS>gwc-js</GWC-JS> </UA_OUTPUT> </APPLICATION>
http://localhost:6394/ua/r/Navigation
Figure 1. Current Application Window in GWC-JS
Figure 2. Two Instances of Application Running in GWC-JS
You should see that both applications have current windows. The first instance of the Navigation application you started (the parent program) continues to run without waiting for the second instance of Navigation (the child program) to finish. The result of your selection will depend on the following: