reload()
Reloads the application page.
Syntax
reload()
Reloads the application page either immediately or with a 50ms delay.
Usage
The reload()
method is a wrapper for the JavaScript API
window.location.reload
object. For more information about the JavaScript API, refer
to Location: reload() method (external link). This method reloads the page you
are running on, in other words it restarts your GWA application. Its use is only recommended for the
purpose of updating a GWA application immediately.
For a complete example, run the GWA "update" demo in your GWA installation directory. If installed in FGLDIR, you will find the demo in $FGLDIR/demo/gwa/update or if installed in a separate directory, you will find it in gwa-install-dir/demo/gwa/update.
IMPORT util
IMPORT FGL fgldialog
IMPORT FGL gwa.app
MAIN
CALL fgl_settitle("Update app")
MENU "Main menu"
COMMAND "Exit"
EXIT MENU
COMMAND "check up to date"
"checks app version/build against the server side"
VAR ret = gwa.app.checkUpToDate()
IF ret.error IS NOT NULL THEN
ERROR "error checking update status:", ret.error
ELSE
MESSAGE "upToDate:",
ret.upToDate,
",versions:",
util.JSON.stringify(ret.versions)
END IF
COMMAND "update dialog"
"performs a Genero driven update if versions have diverged"
VAR ret = gwa.app.updateDialog(reportWhenUpToDate: TRUE)
IF ret.error IS NOT NULL THEN
ERROR "error updating:", ret.error
ELSE
IF ret.updatePerformed THEN
MESSAGE "update performed"
END IF
END IF
END MENU
END MAIN