Web Browser Control Common Properties

Note: This topic documents the Web browser control common properties for use with the WEB-BROWSER2 control. For information on common properties for the deprecated WEB-BROWSER control, see Web Browser Control Common Properties - deprecated.

TITLE

The Web browser control does not use titles.

VALUE

The WEB-BROWSER2 control takes an alphanumeric value, which is the URL.

SIZE

The WEB-BROWSER2 control defines its height by multiplying the LINES value by cell size.

Width is defined by multiplying the SIZE value by the standard or wide font measure. If this control is also boxed, the space required for the box is added to the width. The WEB-BROWSER2 control has a minimum width of at least one character.

COLOR

The WEB-BROWSER2 control ignores specified colors. The actual colors used are system-dependent. Under Windows, the user selects the colors in the Control Panel.

ATW-CSS-CLASS

This property enables you to apply CSS styles to the control when the program is run through AcuToWeb. The value of ATW-CSS-CLASS should represent a corresponding class in the current theme (that is, a .class-name entry in the cascading style sheet) deployed when you run your program through AcuToWeb. This property can be applied to more than one control in your program.

If both the ATW-CSS-CLASS and ATW-CSS-ID properties are specified for this control, and both correspond to the same style in the style sheet, the style specified by ATW-CSS-ID takes precedence.

See Cascading Style Sheet Syntax for more information about additional in-built styles in AcuToWeb.

ATW-CSS-ID

This property enables you to apply CSS styles to the control when the program is run through AcuToWeb. The value of ATW-CSS-ID should represent a corresponding ID in the current theme (that is, a #class-name entry in the cascading style sheet) deployed when you run your program through AcuToWeb. The value of this property must be unique, and only applied to one control in your program.

If both the ATW-CSS-CLASS and ATW-CSS-ID properties are specified for this control, and both correspond to the same style in the style sheet, the style specified by ATW-CSS-ID takes precedence.

See Cascading Style Sheet Syntax for more information about additional in-built styles in AcuToWeb.

EVENT-LIST, EXCLUDE-EVENT-LIST

EVENT-LIST is an exclusive list of events that are either sent to or withheld (blocked) from the program depending on the value of EXCLUDE-EVENT-LIST. See Common Screen Options for more information.

REFRESH (numeric)

Reloads the current page.

STOP-BROWSER (numeric)

Stops any pending navigation or download.

EXECUTE-SCRIPT (alphanumeric)

The value is javascript that you want the browser to execute on the current web-page.

Methods

Methods are implemented as properties in ACUCOBOL-GT. To invoke a method, you modify the control, setting the values of various properties that represent the method parameters. Then, usually in the same modify statement, you set a particular property that represents the method to invoke. Sometimes just setting the value of a control invokes a method.

Here is a table of the methods with their corresponding ACUCOBOL-GT WEB-BROWSER2 control properties and descriptions:

Method Control property Description
GoBack GO-BACK (numeric) Navigates to the previous item in the history list
GoForward GO-FORWARD (numeric) Navigates to the next item in the history list
Navigate NAVIGATE (alphanumeric) Navigates to a resource identified by URL or file path.1
Refresh REFRESH (numeric) Reloads the current page
StopBrowser STOP-BROWSER (numeric) Stops any pending navigation or download
ExecuteScript EXECUTE-SCRIPT (alphanumeric) The value is javascript that you want the browser to execute on the current web-page.
1 http:// is not required, but if omitted and the URL is not found, the WEB-BROWSER2 control then prepends https:// and tries again. If this fails, an error is returned.

To invoke the GoBack, GoForward, and Refresh methods, modify the control, setting the appropriate properties to 1.

For example, to invoke the GoBack method:

MODIFY BROWSER-1 GO-BACK=1.

To invoke the Navigate method, modify the control setting the NAVIGATE property to the desired URL.

For example, to invoke the Navigate method:

MODIFY BROWSER-1 NAVIGATE="http://www.microfocus.com".

Alternatively, if you have defined the WEB-BROWSER2 control with value URL-1 in a screen section item called BROWSER-SCREEN:

MOVE "http://www.microfocus.com" to URL-1.
DISPLAY BROWSER-SCREEN.

These methods are invoked asynchronously. This means that the MODIFY verb may finish executing before the operation is complete. You may check the value of the BUSY property (see Other Properties) to determine whether the operation has completed.