Using HTML Objects

In this section:

How to:

Reference:

HTML Object controls enable you to provide your own HTML code and place it in any location on the form. You can use HTML tags, including Java applets, JavaScript, VBScript, and others. You can also code an Exec to a WebFOCUS report, or a table services report and integrate its output into a form.

The position of the top-left corner of the HTML object on the form determines the starting position of the HTML code after it appears in a browser.

One of the most common uses for an HTML Object is to display the formatted results of a WebFOCUS report. For an example of this technique, see the WebFOCUS Maintain Getting Started manual.

Another use for an HTML Object is to display the resulting page of a Web link in a frame. For more information on this technique, see Defining Events and Event Handlers.


Top of page

x
Procedure: How to Place an HTML Object on Your Form
  1. Select the HTML Object control in the Controls palette.
  2. Draw a rectangle on your form approximately where you want your HTML Object to be at approximately the size you want.
  3. (Optional, but recommended.) Give your HTML Object a more meaningful name than HTMLn.
  4. If necessary, readjust the size and placement of your HTML Object.
  5. Double-click the HTML Object or select the Content property to open the HTML Content Source dialog box. You will use the dialog box to determine the data source for your HTML Object.
  6. To directly set the content of the HTML Object, select As entered below, and then enter the HTML code in the box.

    To assign the content of the HTML Object to a variable, select From a variable. Then select a variable or data source stack column. (You can create a new variable or data source stack by clicking New variable or New data source stack. For more information, see How to Create a Variable in a Procedure or How to Create a Data Source Stack Explicitly Using the Stack Editor.

  7. Click OK.

If you assign the content of the HTML Object to a variable or data source stack column, you will see the name of the variable or data source stack column in the HTML Object.


Top of page

x
Reference: HTML Content Source Dialog Box

Use the HTML Content Source dialog box to define the contents of the HTML Object.

HTML content source dialog box

This dialog box contains the following elements:

Insert HTML content

Select As entered here to set the contents directly.

Select From a variable to set the contents from a variable.

HTML content source dialog box

New variable...

(Only if you selected From a variable.) Opens the New Variable dialog box, where you can create a variable with the data type Stack of.

New data source stack...

(Only if you selected From a variable.) Opens the Stack Editor, where you can create a stack.

List of data source stacks and variables in your procedure

(Only if you selected From a variable.) Contains a list of the existing stacks and variables in your procedure.

Either select a variable, or expand a data source stack and select a column.


Top of page

x
Changing HTML Object Properties

When you select your HTML Object, you will see a list of HTML Object properties in the property sheet. Changing these properties will change what your HTML Object looks like and how it behaves at run time.

Many of the styling properties can also be changed using a Cascading Style Sheet. For more information on Cascading Style Sheets, see Using Cascading Style Sheets.

Do you want...

Then use...

to change the contents of the HTML Object?

the Content property to open the HTML Content Source Dialog Box dialog box.

You can also change the contents of the stack column or variable it is bound to.

to change the name of the HTML Object that identifies it to the procedure?

the (Name) Property property.

to change the size or location of the HTML Object?

the Bottom Property, Left Property, Right Property, and Top Property properties.

a style sheet.

(You can also move or resize the HTML Object directly in the form.) Note that if the Overflow property is set to Visible, the HTML Object will be as wide and as long as necessary in order to display everything.

to change the color of the HTML Object?

the BackColor Property property to determine the background color.

the ForeColor Property property to determine the color of the text.

a style sheet.

to change the text font?

the Font Property property.

a style sheet.

to add a border to the HTML Object?

the Border Property property to determine whether you have a border.

the BorderColor Property property to determine the color of the border.

the BorderWidth Property property to determine the width of the border.

a style sheet.

to make the HTML Object inactive or make it invisible?

the Enabled Property property to determine whether the HTML Object is active or not. (If the HTML Object is inactive, it will be grayed out and nothing will happen when the end user clicks it.)

the Visible Property property to determine whether the HTML Object is visible to the end user.

a style sheet.

to change what the cursor looks like when it is on top of the HTML Object?

the CursorPointer Property property.

a style sheet.

to display a tool tip when the cursor is on top of the HTML Object?

the ToolTipText Property property.

to assign a help topic to the HTML Object?

the Help property. For more information, see Assigning Help to Your Forms and Controls.

to move the HTML Object to another layer?

the Layer property. For more information, see Layering Controls.

to control the display order of the HTML object when more than one control is overlaid?

the ZIndex Property.

Note: IE7 or equivalent required.


WebFOCUS