IWCLink: Displaying a URL in a Browser or Frame

How to:

The IWCLink function displays a URL in a new browser window or in a frame within your current form. You can use IWCLink as part of a technique that enables you to invoke an external procedure without the EXEC command.


Top of page

x
Syntax: How to Display a URL in a Browser or Frame
IWCLink(url, [target], [newwindow], [options])

where:

url

Is the URL of the Web page to display.

target

Is the window or frame to send the URL request output to.

newwindow

Determines if the URL appears in a new browser window. When this parameter is a non-zero or true, a new browser window is created.

options

Are new window parameters. This includes, but is not limited to, the following:

screenX=distance is the distance the new window is placed from the left side of the screen.

screenY=distance is the distance the new window is placed from the top of the screen.

scrollbars={yes|no} determines whether horizontal and vertical scrollbars are created when the document grows larger than the window dimensions. When set to yes, scrollbars are created. When set to no, scrollbars are not created.

status={yes|no} determines whether a status bar appears at the bottom of the window. When set to yes, a status bar is created. When set to no, a status bar is not created.

titlebar={yes|no} determines whether a title bar appears at the bottom of the window. When set to yes, a title bar is created. When set to no, a title bar is not created.

toolbar={yes|no} determines whether a standard browser toolbar appears in the window. When set to yes, a toolbar is created. When set to no, a toolbar is not created.

height=pixels is the height of the window in pixels.

resizable={yes|no} determines whether a user is able to resize the window. If set to yes, a user can resize the window. If set to no, a user cannot resize the window.



Example: Displaying a URL in a Frame

The following JavaScript code is called from a script event handler and uses IWCLink as part of a technique to invoke an external procedure, and to supply the procedure's parameter dynamically at run time.

1. var theReport = "http://172.19.81.107/ibi_apps/WFServlet?IBIF_focexec=rsales4&IBIF_parms=STCD%3D" 
2. theReport = theReport + document.Form1.EditBox1.value;
3. IWCLink(theReport,"MyFrame",0,menubar=no,resizable=no,scrollbars=no,
   status=no,toolbar=no,height=600,width=600");

These commands accomplish the following:

  1. Defines a variable named theReport and initializes it to the target URL.

    When you use IWCLink as part of a technique to invoke an external procedure, the target URL must identify the WebFOCUS script (IPAddress/ibi_apps/WFServlet), the target external procedure (?IBIF_focexec=ProcedureName), and the procedure's parameters (&IBIF_parms=ParameterName%3D). A parameter name is the name of the target procedure's corresponding Dialogue Manager variable without the initial ampersand. Note that %3D is the HTML code for an equal sign; the next statement will append the parameter's value to the equal sign.

    In this case, the target procedure is named rsales4, and rsales4 has a parameter named STCD.

  2. Assigns a value from an edit box (Form1.EditBox1) to the target procedure's STCD parameter by appending the value to the URL string in theReport.
  3. Invokes IWCLink to display a WebFOCUS reporting session, running the external procedure rsales4, in the frame named MyFrame.

    If you want the reporting session to appear in a new browser window, you would leave the second argument blank and change the third argument from 0 to 1.

    The remaining arguments beginning with "menubar" customize the appearance of the browser window; for information about browser settings, see your browser documentation.


WebFOCUS