viewer.envAdded by IBM on August 8, 2013 | Version 1 (Original)
|Returns a string that contains the details of the environment in which IBM® Forms Viewer is operating. Determines whether the Viewer is stand-alone or embedded in a browser, embedded in Eclipse, or embedded in an HTML page. The URL of the submit button changes depending upon the Viewer environment.
Returns A string containing the location of the Viewer, either as stand-alone or inside another object. The strings it can include are:
The Viewer is operating as a standalone Viewer.eclipse
The Viewer is operating inside Eclipse.browser
The Viewer is operating inside a browser.html-object
The Viewer is operating inside an HTML page.
Example The following example determines which environment in which the Viewer is operating. When the Viewer is operating in standalone mode, the form is submitted to server1. If it is operating inside a browser, it is submitted to server2 and so on. Two custom options are used, one containing a compute that calculates the Viewer environment, the other specifying which URL to use for each environment.
<button sid = "Submit">
'off', 'on') == '1' ? viewer.env() : ''"></custom:enviro>
<custom:envString xfdl:compute="custom:enviro == 'standalone'
: custom:enviro == 'browser'
: custom:enviro == 'html-object'
: custom:enviro == 'eclipse'
? ('http://server4/cgi-bin/submit') : ''"></custom:envString>