wrdurl

Holds the URL for the Uniface Web Application Server (WASV).

uniface.wrdurl

Description

You can set the URL to the WRD to be used by assigning it to uniface.wrdurl. This can be done either before or after loading the Uniface javascript API.

For a Uniface web application, the non-semantic URL for the addressing the WASV (the Uniface backend) is the base URL of the HTML page, typically http://Host:8080/uniface/wrd/ComponentName).

For a non-Uniface web application, it is possible to include the Uniface JavaScript library using a single script tag. In this case, the Uniface JavaScript library does not know where to contact the WASV. The uniface.wrdurl enables you to set this URL in JavaScript.

Setting the URL of the WRD Servlet

In the following example, a component instance is created before activating an operation. Prior to instantiation, the URL of the Uniface WRD is set.

function initialize() // Call me at page load time
{
  // Ensure uniface object exists if Uniface runtime not yet loaded:
  window.uniface = window.uniface || {};  

  // Define the URL for the Uniface WRD servlet
  window.uniface.wrdurl = '/uniface/wrd'; // Assumes Uniface backend is on same host as web page
}

function makeInstance()
{
// Call the server with URL http://my-uniface.example:8080/uniface/wrd/MYCOMPONENT 
uniface.createInstance("MYCOMPONENT", "INSTANCENAME").then( 
   function() { uniface.getInstance("INSTANCENAME").activate("myoperation"); }
);
}

Related Topics