View Full Version : Tip: Preview browser windows

2014-03-18, 04:17
You may not be aware of this but Lianja can be given a URL as an argument when it is run. This causes it to create a captive browser window with no menus, tabs or eye-candy. This can be particularly useful for previewing HTML reports that you generate in your App and present it to the user without all the browser accessories.

To fire up a Lianja Web browser client all you need to do is this.


The Lianja.spawn() method will spawn the given command with the specified argument and run it in its own window. The result of the above command produces.


If you need to run background jobs (such as pulling data from web services and updating tables in your App) you can use:

Lianja.spawnApp( filename [, arglist] )

"filename" can be a .prg file, a .php file, a .py file or a .js file.
"arglist" should be a comma separated list of args e.g. "'Hello', 'World', 10, .t."

Note that the background process will not be terminated when you exit Lianja so be sure to create a "lockfile" on entry and remove it on exit.

Also important to note is that Lianja *always* spawns the background processes in runtime mode so they will accessing your runtime data NOT your development data.

If you SET DEBUG ON prior to calling Lianja.spawnApp() then debugging information will be written to c:\lianja\debug\debug_spawnapp.txt to help you diagnose any problems.

Note also that even if you specify a .prg file extension the runtime will *only* run the .dbo files so be sure to compile them first as they will not be "just in time compiled" as is the case in the Lianja App Builder.