Logon.html (JavaScript) and Uniface Command line parameters

Author: nico.peereboom@uniface.com (Nico Peereboom)

The supplied Uniface Anywhere example webpages (http://ua-host/uanywhere/..) to start the UA Client has changed with the introduction of version 5.0.0, to use JavaScript. The supplied example webpages are browser aware and will start (when possible) the correct UA-Client for the used client environment. All relevant application startup parameters for the client are now located in one html file called “logon.html”. These parameters are in the form of: // controlArgs.set([variable]);   When making use of these arguments be aware of the following:

  • The relevant line needs to be uncommented by removing the // in front of the argument that is required.
  • Special characters (like <space>, <_>, <?> etc.) used in values, needs to be escaped for interpretation by the browser.

To automatically escape characters, Javascript has the function: encodeURIComponent.   In next example we want to pass the Uniface arguments: "/adm=c:\u9702\uniface\adm /dir=c:\ua-9702 /asn=c:\UA-9702\_usys.asn” to the application defined in: “controlArgs.set([ "app",           "IDF 9702"      ]);” in the logon.html page.   Example on how to use encodeURIComponent in the Logon.html page: controlArgs.set([ "args",          encodeURIComponent("/adm=c:\\u9702\\uniface\\adm /dir=c:\\ua-9702 /asn=c:\\UA-9702\\_usys.asn")    ]); Be aware that you will still have to escape backslashes with a backslash, as encodeURIComponent does not encode the backslash.

This page has no comments.