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 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 HTML object control in the Controls palette.
  2. Draw a rectangle on your form where you want your HTML Object at approximately the size you want.
  3. Giving your HTML Object a more meaningful name than HTMLn is optional, but recommended.
  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, shown in the following image, 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, as shown in the following image.

HTML content source dialog box

New variable

This is available only if you select From a variable. This option opens the New Variable dialog box, where you can create a variable with the data type Stack of.

New data source stack

This is available only if you select From a variable. This option opens the Stack Editor, where you can create a stack.

List of data source stacks and variables in your procedure

This is available only if you select From a variable. This option 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.

Choose your property based on the task you wish to perform:

If you want to change the contents of the HTML Object, use the Content Property to open the HTML Content Source Dialog Box. You can also change the contents of the stack column or variable it is bound to.

If you want to change the name of the HTML Object that identifies it to the procedure, use the (Name) Property. For more information, see the (Name) Property.

If you want to change the size or location of the HTML Object, use the Bottom Property, Left Property, Right Property, Top Property, or use a style sheet. For more information, see the Bottom Property, Left Property, Right Property, and Top Property. You can also move or resize the HTML Object directly in the form.

Note: 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.

If you want to change the color of the HTML Object, use the BackColor Property to determine the background color, the ForeColor Property, or use a style sheet.

If you want to change the text font, use the Font Property or use a style sheet.

If you want to add a border to the HTML Object, use a style sheet or the Border Property to determine whether you have a border and what type of border it is. The BorderColor Property allows you to determine the color of the border. The BorderWidth Property allows you to determine the width of the border. You may need to increase the BorderWidth and change BorderColor in order to take full advantage of some of the border types.

If you want to make the HTML Object inactive or make it invisible, use the Enabled Property to determine whether the HTML Object is active or not. If the HTML Object is inactive, it will be dimmed out and nothing will happen when the end user clicks it. You can also use the Visible Property to determine whether the HTML Object is visible to the end user or use a style sheet. For more information, see the Enabled Property and the Visible Property.

If you want to change what the cursor looks like when it is on top of the HTML Object, use the CursorPointer Property or use a style sheet.

If you want to display a tooltip when the cursor is on the top of the HTML Object, use the ToolTipText Property.

If you want to assign a Help topic to the HTML Object, use the Help Property. For more information, see Assigning Help to Your Forms and Controls.

If you want to move the HTML Object to another layer, use the Layer Property. For more information, see Layering Controls.

If you want to control the display order of the HTML Object when more than one control is overlaid, use the ZIndex Property. For more information, see the ZIndex Property.


WebFOCUS