Migrate from GWC-HTML5 to GWC-JS

Moving your Genero Web Client for HTML5 (GWC-HTML5) applications to Genero Web Client for JavaScript (GWC-JS) involves some changes to the customization used, topics to help your migration efforts.

Note: It is important to review the features and limitations prior to migrating from the GWC-HTML5 application to the GWC-JS. This topic provides you with tips and recommendations based on migration experience.

Navigating Open Applications

With GWC for HTML5, each application started with RUN or RUN WITHOUT WAITING opens a new tab in your browser. GWC for JavaScript provides a side bar panel. Each application started with RUN or RUN WITHOUT WAITING replaces the application in the current window. You can access the other applications and make them current by selecting them from the side bar panel. See GWC-JS side bar.

File Upload to Server

To upload a file with GWC-HTML5 Web client, you used an EDIT field with the style FileUpload to create a file chooser dialog.
EDIT sfile1=formonly.sfile1, style="FileUpload";
Important: The FileUpload style is not supported by GWC-JS.
To migrate from GWC-HTML5 to GWC-JS, you need to remove FileUpload style and add a call to openFile front call, followed by call to fgl_getfile. This is the same file upload method as you use in Genero Desktop Client (GDC):
  1. Use the openFile front call to open the file chooser dialog so that the user can select a file to upload.
    DEFINE infile STRING
    
        CALL ui.Interface.frontCall("standard", "openFile",
        ["c:\\fjs\\doc","doc.pdf","*.pdf","Choose a file to upload"],
        infile)
    Note: For GWC-JS, the path parameter is ignored, and wildcards can only hold one type of file extension. For more information on the use of this command, please see the "Standard front calls" section in the Genero Business Development Language User Guide.

    Image shows example of file chooser pop-up window that is displayed by the front call openFile function in an application opened by the GWC-JS front-end.

    Figure 1. GWC-JS File Upload Pop-up Window

  2. Use the fgl_getfile to upload the file the user has chosen. The call to the fgl_getfile function requires no interaction from the user so it can be called immediately to upload the file to a directory specified in the application server.
    TRY
            CALL fgl_getfile(infile, /opt/myapp/received_files)
            CALL fgl_winmessage("File uploaded", infile, "info") # Display a window with message after uploading
        CATCH
            ERROR sqlca.sqlcode, " ", sqlca.sqlerrm  # Catch runtime execution errors from the SQLCA diagnostic record
        END TRY