Siebel Advisor API Reference > Pageset Functions for Siebel Advisor >

BuildWidget


Usage

Use the BuildWidget function to add the following input UI controls to a display page in a browser-based application:

  • Image map
  • List box
  • Radio button
  • Check box
  • Text box

The image map, list box, radio button, and check box input UI controls allow a user to make feature selections in a browser-based application. The text box input UI control allows the user to enter data that can be reused in the application.

You call the BuildWidget function in the <BODY> section of a display page. Also, all BuildWidget calls must be inside the <FORM> section of the HTML source of display pages. The function is usually called from within a JavaScript document.write method.

Syntax

BuildWidget(type,window,name[,arg1,arg2,arg3,arg4,arg5])

Argument
Description

type

Specifies the type of input UI control to create. Valid control types are:

CHECKBOX: see Check Box Input UI Controls.

MAP: see Image Map Input UI Controls.

LISTBOX: see List Box Input UI Controls.

RADIO: see Radio Button Input UI Controls.

GETTEXT: see Text Entry Input UI Controls.

name

Defines the source of the content that populates the input UI control.

arg1 - 5

Some input UI control types take additional arguments.

Check Box Input UI Controls

The syntax used to create a check box input UI control is:

ISS.BuildWidget("CHECKBOX",window,name)

Argument
Description

name

Defines the source of the content that populates the input UI control. For check box input UI controls, this is the name of a Feature table in the Advisor project.

Notes

The Feature table associated with a check box input UI control defines whether the input UI control is checked or cleared. Therefore:

  • Only the first two rows of the Feature table are significant for this input UI control.
  • The first row represents the cleared state, and the value in its CODE column must be equivalent to false (F, FALSE, or 0).
  • The second row represents the checked state, and the value in its CODE column must be equivalent to true (T, TRUE,
    or 1).
  • When a value is specified in the DEFAULT column of one row, the state represented by the row is the state of the check box when the pageset is first loaded.
Example

The following sample code creates a check box input UI control:

<TR>

<TD><FONT face=verdana size=2><B>Personalized Plates
</B><IMG src=trans.gif width=10></TD>

<TD><SCRIPT>  document.write(ISS.BuildWidget ("CHECKBOX",window,"PLATE"));</SCRIPT></TD>

</TR>

Image Map Input UI Controls

An image map input UI control functions in much the same way as a group of radio button input UI controls function. For example, an image map input UI control can take the form of a three-color item. Users would click on a color, instead of a radio button, to make a selection.

In the relevant Feature table, you must specify the UI control name and its map name, input shape, and coordinates. You can swap your own image files to represent a selected palette, but you must provide your own browser-specific code to use DHTML to swap images.

The syntax used to create an image map input UI control is:

ISS.BuildWidget("MAP",window,name,mapName,fileCol, shapeCol,coordCol)

Argument
Description

name

Feature table name and the name of the input UI control that corresponds to the information represented by the image map (for example, COLOR).

mapName

Name of the image map. All image maps must have unique names. Image maps cannot be named map.

file

File name of the image (or name of a table column that contains the file name of the image) used.

shapeCol

Advisor data column that contains the shape of the image map area.

coordCol

Advisor data column that contains coordinates of the image map area.

Example

The following sample code creates an image map input UI control whose image source file name is defined in the PICT column of the COLOR Feature table:

<SCRIPT>

document.write(ISS.BuildWidget("MAP",window,"COLOR",
"color_map","PICT","SHAPE","COORD"));

</SCRIPT>

The following sample code creates an image map input UI control that directly calls the image source file called Flag.gif. This file should be located the pg directory.

<SCRIPT>

document.write(ISS.BuildWidget("MAP",window,"COLOR",
"color_map","Flag.gif","SHAPE","COORD"));

</SCRIPT>

List Box Input UI Controls

The name argument is the name of the Feature table that contains the data used to populate the list. The data in the DESC column of this table is always used to populate the list. Additionally, you must specify height, width, and prefill arguments for the input UI control.

The syntax used to create a list box input UI control is:

BuildWidget("LISTBOX",window,name,height,width,prefill)

Argument
Description

name

Defines the source of the content that populates the input UI control. For list box input UI controls, this is the name of a Feature table in the Advisor project. Items in the list box will be filled in sequentially using the entries in the DESC column of this table.

height

For list box input UI controls, this argument is an integer that specifies the number of visible rows for the list box. Set this argument to 1 to create a drop-down list.

width

Integer that specifies the width of the list box, as defined by the number of characters visible in the default browser font.

prefill

Boolean value that sets the width of the list box control to accommodate the widest item in the list. If prefill is TRUE and width is greater than the number of characters in the longest line of text appearing in the list box, the list box appears with a width equivalent to width. If prefill is FALSE, the width is set to accommodate the longest line of text that appears in the list box.

Notes
  • In Internet Explorer 4.x and 5.x browsers, selections in the list box appear in the standard system font. In Netscape 4.x, selections appear in the font in which text at that location would normally appear—either in the font specified for the entire document, or a font specified by an enclosing <FONT> tag set.
  • The DEFAULT column in the associated Feature table determines which item in the list box is selected when the pageset is initially loaded. If no row in the table contains the value DEFAULT, the item that corresponds to the first row in the table is selected.
Example

The following sample code creates a list box that draws feature data from the Feature table COLORINT. Note that the actual caption text is created using a separate HTML entry.

Choose an interior color:

<SCRIPT>

document.write(ISS.BuildWidget("LISTBOX",window,
"COLORINT",1,38,true));

</SCRIPT>

Radio Button Input UI Controls

You can create a radio button input UI control that uses a graphic caption for the radio button instead of a text caption.The graphic specified for the imageFile argument will be used for the button caption.

The syntax used to create a radio button input UI control with a text caption is:

ISS.BuildWidget("RADIO",window,name,indexRow[,imageFile])

Argument
Description

name

Defines the source of the content that populates the input UI control. For list box input UI controls, this is the name of a Feature table in the Advisor project. A radio button input UI control is associated with a particular row in the table. The row is specified by the indexRow argument.

indexRow

The row in the specified Feature table for which the button is created. (Note that the first row in the table is considered row '0'.)

imageFile

Optional. Advisor data column, such as PICT, that contains information about the graphic, such as the name of the image file.

Notes
  • A separate BuildWidget function call is required for each row in a Feature table that is associated with a radio button.
  • The DEFAULT column in the associated Feature table determines which radio button is selected when the pageset is initially loaded. If no row in the table contains the value DEFAULT, the radio button that corresponds to the first row in the table is selected.
Examples

The following sample code creates a radio button input UI control. This input UI control is based on the first row of the Feature table BODY, and the indexRow argument is set to 0. The caption text is created using a separate HTML entry.

<SCRIPT>

document.write(ISS.BuildWidget("RADIO",window,"BODY",0));

</SCRIPT>2-Door Coupe

The following sample code creates the same 2-Door Coupe radio button as in the previous example, but with a graphic caption.

<SCRIPT>

document.write(ISS.BuildWidget("RADIO",window,
"BODY",0,"PICT"));

</SCRIPT>

The PICT argument will first attempt to get the graphic from BODY.PICT. If there is no PICT column in BODY, it will get the graphic directly.

<SCRIPT>

document.write(ISS.BuildWidget("RADIO",window,"BODY",0,
"TwoDoorCoupe.gif"));

</SCRIPT>

TwoDoorCoupe.gif should reside in the pg directory.

Text Entry Input UI Controls

A text entry input UI control allows you to enter text in the application. This text is stored as a value in the selection set under the name specified as the name argument.

The syntax used to create a text entry input UI control is:

BuildWidget("GETTEXT",window,name,width)

Argument
Description

name

Name associated with the text box input UI control. Text entered in this input UI control is stored under this name.

width

Specifies the width of the text box. width is any positive integer. The value for width is approximately equal to the number of characters (in the default browser font) visible across the box at one time.

Notes
  • The name of a text entry input UI control:
    • Must be a unique name throughout the pageset
    • Can contain letters and numbers, but must begin with a letter
    • Can contain no spaces or punctuation except for an underscore
  • There are currently no restrictions on the number of characters that can be typed into a text entry field.
  • Do not enter the following text into a text entry field:
    • Unescaped double quotes
    • Any opening script tag such as <!-- or <SCRIPT>
Example

The following sample code creates a text entry input UI control. The caption text is created using a separate HTML code. Text entered into this input UI control is saved under the name PLATETEXT.

Enter text for your custom license plate:

<SCRIPT>document.write(ISS.BuildWidget("GETTEXT",window,
"PLATETEXT",8));</SCRIPT>

Siebel Advisor API Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.