Graphical mode with Universal Rendering

What is the Universal Rendering mode?

In graphical mode, each type of front-end uses by default the native Graphical User Interface API and widgets of the platform or framework used to implement the front-end. This is called the Native Rendering mode.

Genero supports also the Universal Rendering mode, to unify the display of application forms on all front-ends, with a common rendering solution based on the GBC front-end using web technologies.

Figure: Universal Rendering window example

Universal Rendering screenshot

Enabling Universal Rendering with FGLPROFILE: gui.rendering

The Universal Rendering mode is enabled with the following FGLPROFILE entry:
gui.rendering = "universal"
One can explicitly force Universal Rendering to be disabled by setting this entry to "native":
gui.rendering = "native"
Note: The gui.rendering option takes precedence over the Universal Rendering option in the front-end settings (when available). If the front-end option enables Universal Rendering by default, and gui-rendering="native" is set, the application forms will be displayed in Native Rendering mode.

Defining the GBC to be used in direct mode

When using Universal Rendering mode in direct mode, it is possible to configure which GBC version has to be transmitted by the runtime system to the front-end.

The GBC component files must be located on the computer where the fglrun program executes, and will be transferred when the application starts.

The GBC component will be searched in the following directories:
  1. The appdir/gbc directory, where appdir is the directory where the program file is located,
  2. The directory defined in the FGLGBCDIR environment variable,
  3. The $FGLDIR/web_utilities/gbc/gbc directory.
If defined, make sure that FGLGBCDIR is set to a directory containing the GBC component files.
Note: The FGLGBCDIR environment variable is provided to select a given GBC when using the GUI direct mode. FGLGBCDIR is ignored when using the GAS: As a general pattern, if a specific GBC is to be coupled with a particular application in production, consider shipping GBC in appdir/gbc. Otherwise, use the GBC available by default.
Tip: Set the FGLGUIDEBUG environment variable, to enable GUI protocol debug logging and verify which GBC is transmitted to the front-end by the runtime system. Search for log lines like:
*** uic_FT_processGet.1188: requestedName=gbc://index.html realName=/app/gbc/index.html

Defining the GBC to be used with the GAS

When executing applications through the Genero Application Server, displaying on the GDC, GMA or GMI front-ends, the GBC component files are found with the mechanism available in the GAS.

The $APPDIR/gbc directory is the recommended location for a production environment, when a specific GBC is required by an application. This is typical when an application requires a specific GBC customization.

Otherwise, if no specific GBC is required, the default GBC set in the GAS configuration will be used (check the GBC_LOOKUP_PATH .xcf parameter)
Note: The FGLGBCDIR environment variable is not taken into account by the GAS to define the GBC.

For more details about GBC usage with the GAS, see the Configuring GBC client for applications topic in the Genero Application Server User Guide.

Building mobile apps with a specific GBC

When building a GMA or GMI app using Universal Rendering, the GBC component needs to be bundled with the app package.

The gmabuildtool and gmibuildtool commands support an option to specify the GBC to be bundled with the app.

If this build option is used, the app will by default display in Universal Rendering mode: There is no need to define the gui.rendering = "universal" FGLPROFILE entry.

For more details, see Building Android apps with Genero, Building iOS apps with Genero.

Checking for Universal Rendering in programs

In the program code, use the following APIs to check if Universal Rendering mode is used:
  1. ui.Interface.getUniversalClientName()
  2. ui.Interface.getUniversalClientVersion()
Note: These methods are especially useful for debugging purpose. Consider writing code that is not dependent on the Native Rendering or Universal Rendering mode.