[Contents] [Previous] [Next] [Last]

Chapter 9
JavaScript Components

This chapter lists and describes all of the built-in JavaScript components and the properties, methods, and events of each.

JavaScript components are written in the JavaScript language. For detailed information about JavaScript syntax, see the JavaScript ReferenceJavaScript components are defined and described in .jsb files, which can be found in the netscape/peas directory of your Visual JavaScript installation. In addition to the information given here, you can refer to each component's source file for complete details of implementation. For information about the structure of a .jsb file, see Netscape Component Developer's Guide.

JavaScript components differ from Java components in that you can specify property values as JavaScript expressions.

Note that when an application uses client-side JavaScript components, the runtime environment must include a JavaScript-enabled browser.

Components are presented below alphabetically. The properties are listed alphabetically by the display name under which they are appear in the Inspector. These differ from the actual property names that are used to access property values in code.

These are the built-in JavaScript components:

Custom Server Table

The Custom Server Table is a server-side JavaScript component that creates a customizable HTML table containing query results when connected through the Cursor property to a server-side cursor component on the same page. (Because the Connection Builder makes only client-side connections, you cannot use it connect the Custom Server Table component to a cursor.) The properties specify the visual appearance of the table. The contents of the table are automatically generated from the cursor's dataset.

If you specify Enable Sort Selection? as true, the component also runs client-side JavaScript.

The component has no events and no methods.

A descriptive source file for this component is install dir/netscape/peas/CustomTable.jsb

Properties

Custom Server Table  
Property Description
Alignment

Alignment of the table with respect to surrounding text. Default value is left.

Property name: align

Value type: string (left, right)

Background Color

Background color of table. The color is expressed as a color name or an RGB hex triplet.

Property name: bgColor

Value type: color

Border Width

The width, in pixels, of the border around the table. When the value is 0, no border is drawn. Default value is 2.

Property name: border

Value type: number

Caption Font Size

Font size of caption, 1 through 7. Default value is 4.

Property name: captionFontSize

Value type: number

Caption Position

Position of caption. Default value is top.

Property name: captionPos

Value type: string (top, bottom)

Caption Text

Text for table caption. Default value is Results of Query.

Property name: caption

Value type: string

Cell Padding

Number of pixels between cell border and contents. Default value is 1.

Property name: cellPadding

Value type: number

Cell Spacing

Number of pixels between cells. Default value is 2.

Property name: cellSpacing

Value type: number

Column Headings?

When set to true, displays column headings. The column names retrieved from the cursor are used as column headings, unless different values are specified in the Custom Headings property. Default value is false.

Property name: colHeadings

Value type: boolean

Cursor

Name of cursor component from which to get data. This must be a server-side cursor on the same page as the table.

Property name: sourceCursor

Value type: object

Custom Headings

A string specifying custom headings to use instead of the column names from the cursor, when the Column Headings property is true.

The value is a string with the column name and custom name for each column in comma-separated pairs, delimited by semicolons. For example:

"colname1,Cust Name1;colname2, Cust Name2;..."

Property name: customHeadings

Value type: string

Detail Page

URL of detail page (if any) to which to link. A detail page shows data from a table related through the Key Column and Foreign Key Column properties.

Property name: detailPage

Value type: string

Detail Target

Name of frame or window in which to display detail data

Property name: detailTarget.

Value type: string

Enable Sort Selection?

When set to true, column headings are hyperlinks that the user can select to sort the query results by the values in that column. This capability is provided through client-side JavaScript. When false, the table is a purely server-side component.

Property name: enableSortSelection

Value type: boolean

Foreign Key Column

Foreign key column for detail linking (if any). This is the name of the column in the detail table that corresponds to the Key Column property.

Property name: FkeyCol

Value type: string

Heading BG Color

Background color of heading. The color is expressed as a color name or an RGB hex triplet.

Property name: headBGColor

Value type: color

Horizontal Alignment

Horizontal alignment of text within cells. Default value is left.

Property name: hAlign

Value type: Enumerated (left, right, center)

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Key Column

Key column for detail linking (if any). This is the name of the column in the master table that corresponds to the Foreign Key Column property. Default value is id.

Property name: keyCol

Value type: string

Layout

Specifies whether the information is displayed in a standard table (columnar) or form-style, with labeled values (horizontal and horizontal-centered).

Property name: layout

Value type: string (columnar, horizontal, horizontal-centered)

No Wrapping

When set to true, does not wrap cell contents; when set to false, wraps cell contents. Default value is true.

Property name: nowrap

Value type: boolean

Separator

When Layout is horizontal or horizontal-centered, specifies whether to draw a separator between row values.

Property name: separator

Value type: string (none, line, half-line)

Vertical Alignment

Vertical alignment of contents within cells. Default value is center.

Property name: vAlign

Value type: string (top, center, bottom, baseline)

Width

The width of the table in pixels, or as a percentage of the window width (when expressed as n%). Default value is 100%.

Property name: width

Value type: number

Database Form Handler

The Database Form Handler is a server-side JavaScript component that processes a form submission and inserts, updates, or deletes a row in a database table. The component does not appear visually in the end-user interface.

The component can be configured to run JavaScript code on the client, the server, or both in response to the success or failure of the submission.

You can put this component on a page by itself, or with explanatory text and/or other server-side processing components such as Send Mail from Server. The Form component to be submitted should have the URL of this page in its Action property, and its Method property should be GET.

The component has no events and no methods.

A descriptive source file for this component is install dir/netscape/peas/FormAccept.jsb

Properties

Database Form Handler  
Property Description
DBPool

Name of LiveWire DBPool component from which to get the connection.

Property name: dbpool

Value type: DBPool

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Key Fields (ES2)

For Enterprise Server 2.0, a comma-delimited list of key fields in the table being operated on.

Property name: keyFields

Value type: string

On Failure - Client

Client-side JavaScript statements to execute if the operation fails for some reason.

Property name: onFailClient

Value type: string

On Failure - Server

Server-side JavaScript statements to execute if the operation fails for some reason.

Property name: onFailServer

Value type: string

On Success - Client

Client-side JavaScript statements to execute if the operation succeeds.

Property name:onSuccessClient

Value type: string

On Success - Server

Server-side JavaScript statements to execute if the operation succeeds.

Property name:onSuccessServer

Value type: string

Operation

Defines the database operation that will be performed.

Property name: operation

Value type: string (insert, update, delete)

Table Name

The name of the database table on which the specified operation (insert, update, or delete) will be performed.

Property name: table

Value type: string

Database Select List

The Database Select List is a server-side JavaScript multiple-choice selection list form element. The contents are generated automatically from data. A connection is established through the specified LiveWire DBPool component. A query is automatically generated from the Table and Filter Column specifications. Property values determine how the data values are retrieved and displayed. Each row of the result set is displayed as a selection option. You can specify column headings, determine how values are displayed and returned, and sort the result set.

This component has a client-side part that supports property and event connections. Use the getValue method to retrieve the selected option, and setValue to select an option programmatically.

A descriptive source file for this component is install dir/netscape/peas/DBSelect.jsb

Properties

Database Select List  
Property Description
Box Size

The number of options displayed in the select list. Default value is 5.

Property name: size

Value type: number

DBPool

The name of the LiveWire DBPool component from which to establish a database connection.

Property name: dbpool

Value type: DBPool

Default Value

The value of the option that is selected by default.

Property name: defaultValue

Value type: string

Filter Column

Name of column with which to qualify the query, based on value passed in request object. For example, if the Filter Column value is custID, then the WHERE clause is: WHERE custID = request.custID. This assumes that a value for custID is passed in the request for the page.

Property name: filterCol

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Max Rows

Maximum number of rows to retrieve. Default value is 100.

Property name: maxRows

Value type: number

Multiple Selection

When set to true, multiple selections are allowed. Default value is false.

Property name: multiple

Value type: boolean

Sort Column

Column by which to sort the query results.

Property Name sortCol

Value type: string

Sort Direction

Order in which to sort the contents.

Property name: sortAscending

Value type: string (ascending, descending)

Table

Name of table from which to get data. The name must be quoted if a literal value, or a string-valued variable.

Property name: table

Value type: string

Text Column

Name of column that determines text displayed by each option. Must be quoted if a literal value, or a string-valued variable.

Property name: textColumn

Value type: string

Text Expression

An expression to be evaluated in the context of the query and displayed as the text in the options in the select list. For example, if the query contains a column called custName, the value "Cust Name:"+ custName would result in display of the literal string "Cust Name" followed by each customer name, for example, "Cust Name: John Smith".

Property name: textExpr

Value type: string (JavaScript expression)

Value Column

Name of column that determines values of each option. Must be quoted if a literal value, or a string-valued variable.

Property name: valueColumn

Value type: string

Value

The currently selected option. Use the getValue method to retrieve the current selection, and the setValue method to change the selection.

Property name: value

Value type: string (JavaScript expression)

Methods

Database Select List  
Method Description
getValue

Retrieves the value of the selected option.

Arguments: none

Return value: value (string)

setValue

Sets the selection to the option with the specified value.

Arguments: newValue (string)

Return value: none

Events

.

Database Select List  
Event Description
onBlur

Occurs when a user action causes the component to lose the keyboard focus.

onChange

Occurs when the user changes the value in the component and moves the keyboard focus elsewhere.

onFocus

Occurs when a user action causes the component to gain the keyboard focus.

property value change

Occurs when the Value property changes.

Date Display

The Date Display is a client-side JavaScript component that displays the current date or date on which the document was last modified. Property values determine the format of the display.

The component has no events and no methods.

A descriptive source file for this component is install dirinstall dir/netscape/peas/DateDisplay.jsb

Properties

Date Display  
Property Description
ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Show Day of Month?

When set to true, displays day of month. Default value is true.

Property name: showMonthDay

Value type: boolean

Show Month?

When set to true, displays month. Default value is true.

Property name: showMonth

Value type: boolean

Show Seconds?

When set to true, displays seconds (only if Show Time? property is true). Default value is true.

Property Name: showSeconds

Value type: boolean

Show Time?

When set to true, displays time of day. Default value is true.

Property name: showTime

Value type: boolean

Show Week Day?

When set to true, displays day of week. Default value is true.

Property name: showWeekDay

Value type: boolean

Show Year?

When set to true, displays year. Default value is true.

Property name: showYear

Value type: boolean

Type

Displays current date or document last-modified date. Default value is lastModified.

Property name: type

Value type: string (current, lastModified)

JavaScript Check Box

The JavaScript Check Box is a client-side JavaScript component that generates a labeled check box form element. It supports property and event connections.

Use the getValue method to retrieve the selection state, and the setValue method to change the selection state programmatically.

A descriptive source file for this component is install dir/netscape/peas/CheckBox.jsb

Properties

JavaScript Check Box  
Property Description
Default Value

When set to true, the check box is selected by default. Default value is false.

Property name: defaultValue

Value type: boolean

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Text to Display

Label text to display next to the check box. Default value is Check Box Text.

Property name: textToDisplay

Value type: string

Value

Reflects and controls the selection state of the check box at run time. True when the check box is selected, false when it is not. Use the getValue method to access this value, and the setValue method to change the selection state. Default value is false.

Property name: value

Value type: boolean

Methods

JavaScript Check Box  
Method Description
getValue

Retrieves the selection state of the check box.

Arguments: none

Return value: value (boolean)

setValue

Sets the selection state of the check box.

Arguments: newValue (boolean)

Return value: none

Events

JavaScript Check Box  
Event Description
onBlur

Occurs when the check box loses keyboard focus.

onChange

Occurs when the user selects or deselects the check box.

onFocus

Occurs when the check box is given keyboard focus.

property value change

Occurs when the Value property changes.

JavaScript Client Cursor

The JavaScript Client Cursor is a JavaScript database cursor component that runs on both the server and the client. The cursor component creates a LiveWire database cursor based on the query specified in the SQL Query property and constructs a buffer for the result set in client JavaScript. You can connect HTML form elements to the cursor to display values and call the component's methods, which can scroll through the result set and modify the database. See Writing Server-Side JavaScript Applications for more information on cursors.

The cursor must connect to a LiveWire DBPool component in the same project.

The JavaScript Client Cursor component supports direct connections and property connections. Property change events occur in response to changes in bound properties. In this component, bound properties include dynamically added properties that correspond to database columns.

A descriptive source file for this component is install dir/netscape/peas/JSBufferedCursor.jsb

Properties

JavaScript Client Cursor  
Property Description
Current Row Number

Specifies and reflects the current row number. Used only at run time. The nextRow and previousRow methods increment and decrement this value. Use the getCurrentRowNumber method to access the value.

Property name: currentRowNumber

Value type: number

DBPool

Name of LiveWire DBPool component from which to get database connection.

Property name: dbpool

Value type: DBPool

Filter Column

Name of column by which to filter the value passed in the request server object.

Property name: filterCol

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Max. Rows

Maximum number of rows to retrieve. Default value is 100.

Property name: maxRows

Value type: number

Number of Rows

Number of rows actually retrieved. (Used only at run time.)

Property name: numRows

Value type: number

Sort Column

Column by which to sort the query results.

Property name: sortCol

Value type: string

Sort Direction

Order in which to sort the query results.

Property name: sortAscending

Value type: string (Ascending, Descending)

SQL Query

SQL select statement that defines cursor data set.

Property name: SQL

Value type: SQLQuery

Updatable

When set to true, the user can use the cursor to update data in the connected database. Default value is true.

Property name: updatable

Value type: boolean

Methods

JavaScript Client Cursor  
Method Description
addRow

Clears current values of connected form elements, replacing with "?".

Arguments: none

Return value: none

deleteRow

Deletes current row from database.

Arguments: none

Return value: none

executeQuery

Causes the specified query to be executed an the result set to be initialized.

Arguments: none

Return value: none

getCurrentRowNumber

Returns row number of current row.

Arguments: none

Return value: row (int)

getNumRowsFetched

Returns total number of rows actually retrieved from database and sent to client.

Arguments: none

Return value: num (number)

nextRow

Goes to next row in client data set.

Arguments: none

Return value: success (boolean)

previousRow

Goes to previous row in client data set.

Arguments: none

Return value: success (boolean)

setCurrentRowNumber

Changes the current row number to the specified row number.

Arguments: row (int)

Return value: success (boolean)

updateCurrentRow

Changes values of current row in database based on current values of connected form elements.

Arguments: none

Return value: none

Events

JavaScript Client Cursor  
Event Description
onChange

Occurs when any bound property changes.

property name change

Occurs when the referenced property changes. These events and properties are added dynamically when the cursor is connected to data, and correspond to the database columns.

rowChange

Occurs when any change occurs in the current row--either to an individual value, or to the row composition.

JavaScript Radio Group

The JavaScript Radio Group is a client-side JavaScript component that generates a radio button group form element. It supports property and event connections.

Use the getValue method to retrieve the selected option, and the setValue method to select an option programmatically.

A descriptive source file for this component is install dir/netscape/peas/RadioGroup.jsb

Properties

JavaScript Radio Group  
Property Description
Default Value

The value of the option that is selected by default (if any). The default value is the empty string, meaning that no option is initially selected. Use the setValue method to change the selection programmatically.

Default value is 2.

Property name: defaultValue

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Text Options

A semicolon-delimited list of strings that are displayed by each button. The entire list must be enclosed in quotes, and each item must be followed by a semicolon and a space. The default value ("one; two; three") results in a display with three options "one," "two," and "three."

Property name: textOptions

Value type: string

Value

The value of the current selection at run time. Use the getValue method to access this value, and the setValue method to change the selection programmatically.

Value type: string

Value Options

A semicolon-delimited list of values for each option. The values of selected options are submitted when the form is submitted. The entire list must be enclosed in quotes, and each item must be followed by a semicolon and a space. The default value ("1; 2; 3") assigns the values 1, 2, and 3 to the first three option items in the select list.

Property name: valueOptions

Value type: string

Methods

JavaScript Radio Group  
Method Description
getValue

Retrieves the value of the current selection.

Arguments: none

Return value: value (string)

setValue

Selects the option corresponding to the specified value.

Arguments: newValue (string)

Return value: none

Events

JavaScript Radio Group  
Event Description
onBlur

Occurs when the radio group loses keyboard focus.

onChange

Occurs when the user selects an option.

onFocus

Occurs when the radio group is given keyboard focus.

property value change

Occurs when the Value property changes.

JavaScript Select List

The JavaScript Select List is a JavaScript component, with both server- and client-side parts, that generates a multiple-choice Select List form element. In contrast to the Database Select List component, it has a fixed set of options, specified in the Text Options property. The selected option's value, as specified in the Value Options property, is submitted with the containing form.

This component supports property and event connections. Use the getValue method to retrieve the selected option, and setValue to select an option programmatically.

A descriptive source file for this component is install dir/netscape/peas/SelectBox.jsb

Properties

JavaScript Select List  
Property Description
Box Size

Number of options visible. If set to 1, the component looks like a drop-down list. If the value is greater than 1, the component looks like a scrolling list. Default value is 5.

Property name: size

Value type: number

Default Value

The value of the option that is selected by default (if any). Default value is the empty string, meaning that there is no initial selection. Default value is 2.

Property name: defaultValue

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Text Options

A semicolon-delimited list of strings that are displayed in the list. The entire list must be enclosed in quotes, and each item must be followed by a semicolon and a space. The default value ("one; two; three") results in a display with three options "one," "two," and "three."

Property name: textOptions

Value type: string

Value

The value of the selected option. Use the getValue method to access this value, and the setValue method to change the selection programmatically.

Property name: value

Value type: string

Value Options

A semicolon-delimited list of values for each option. The values of selected options are submitted when the containing form is submitted. The entire list must be enclosed in quotes, and each item must be followed by a semicolon and a space. The default value ("1; 2; 3") assigns the values 1, 2, and 3 to the first three option items in the select list.

Property name: valueOptions

Value type: string

Methods

JavaScript Select List  
Method Description
getValue

Retrieves the value of the current selection.

Arguments: none

Return value: value (string)

setValue

Selects the option corresponding to the specified value.

Arguments: newValue (string)

Return value: none

Events

JavaScript Select List  
Event Description
onBlur

Occurs when the list loses keyboard focus.

onChange

Occurs when the user selects or deselects an option.

onFocus

Occurs when the list is given keyboard focus.

property value change

Occurs when the Value property changes.

JS Dummy Cursor

The JS Dummy Cursor is a sample client-side JavaScript component, intended for demonstration and testing purposes. The component is the equivalent of the client part of a JavaScript Client Cursor, with "dummy" data to mimic the behavior of a cursor without requiring a server or a database connection.

The JS Dummy Cursor component supports direct connections and property connections. Property change events occur in response to changes in bound properties. In this component, bound properties include SQL Query, Current Row Number, and dynamically added properties that correspond to database columns.

A descriptive source file for this component is install dir/netscape/peas/DummyCursor.jsb

Properties

JS Dummy Cursor  
Property Description
Current Row

Specifies and reflects the current row number. The nextRow and previousRow methods increment and decrement this value. Use the setCurrentRowNumber method to set the value.

Property name: currentRowNumber

Value type: number

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Number of Rows

Number of rows actually retrieved. (Used only at run time.)

Property name: numRows

Value type: number

Updatable

When set to true, the user can use the cursor to update data in the dummy database. Default value is false.

Property name: updatable

Value type: boolean

Methods

JS Dummy Cursor  
Method Description
executeQuery

Executes the current query.

Arguments: none

Return value: none

getCurrentRowNumber

Retrieves the current row number.

Arguments: none

Return value: rowNumber (number)

getNumRowsFetched

Returns the number of rows retrieved in the most recent query.

Arguments: none

Return value: rowsFetched (number)

nextRow

Increments the current row number to get the next row in the client data set.

Arguments: none

Return value: success (boolean)

previousRow

Decrements the current row number to get the previous row in the client data set.

Arguments: none

Return value: success (boolean)

setCurrentRowNumber

Changes current row number. Takes one parameter, a number.

Arguments: newRowNumber (number)

Return value: none

Events

JS Dummy Cursor  
Event Description
onChange

Occurs when any bound property changes.

property name change

Occurs when the referenced property changes. These events and properties are added dynamically when the cursor is connected to data, and correspond to the database columns.

rowChange

Occurs when any change occurs in the current row--either to an individual value, or to the row composition.

LiveWire Cursor

The LiveWire Cursor is a server-side JavaScript component that creates a LiveWire database cursor based on the query defined in the SQL Query property. It has methods for scrolling through the result set and for modifying the database. See Writing Server-Side JavaScript Applications for more information on LiveWire cursors.

Because the Connection Builder makes only client-side connections, you cannot use it to connect this server-side cursor to a table or form. You can connect a LiveWire Cursor component to a Custom Server Table component by referring to it in the Custom Server Table's Cursor property.

The component has no events.

A descriptive source file for this component is install dir/netscape/peas/Cursor.jsb

Properties

LiveWire Cursor  
Property Description
DBPool

Name of LiveWire DBPool component from which to get database connection.

Property name: dbpool

Value type: DBPool

Filter Column

Name of the column on which to filter by the value passed in the request object. If this cursor is used for detail in a master-detail relationship, the name of the join column in the master-detail relationship. This column is used to qualify the query. (For example, if the master table is department and the detail table is employees, the FilterColumn might be the column departmentNumber, because it identifies all employees in a given department.)

Property name: filterCol

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Sort Column

Column by which to sort the query results.

Property name: sortCol

Value type: string

Sort Direction

Order in which to sort the query results.

Property name: sortAscending

Value type: string (Ascending, Descending)

SQL Query

SQL select statement that defines the cursor's dataset.

Property name: SQL

Value type: SQLQuery

Updatable

When set to true, the user can use this cursor to update data in the connected database.

Property name: updatable

Value type: boolean

Methods

LiveWire Cursor  
Method Description
close

Closes the cursor and frees the allocated memory.

Arguments: none

Return value: none

columnName

Returns the name of the column in the cursor corresponding to the specified number.

Arguments: colNumber (number)

Return value: name (string)

columns

Returns the number of columns in the cursor.

Arguments: none

Return value: num (int)

deleteRow

Deletes the current row in the specified table.

Arguments: tableName (string)

Return value: status (number)

insertRow

Inserts a new row in the specified table.

Arguments: tableName (string)

Return value: status (number)

next

Moves the current row to the next row in the cursor.

Arguments: none

Return value: success (boolean)

updateRow

Updates records in the current row of the specified table in the cursor.

Arguments: tableName (string)

Return value: status (number)

LiveWire DBPool

The LiveWire DBPool is a server-side JavaScript component that establishes a database connection. It represents a pool of connections to a particular database configuration. Multiple components can use the same connection by referring to the same LiveWire DBPool object in their DBPool properties.

This is a component wrapper for the LiveWire DBPool object. See Writing Server-Side JavaScript Applications for more information.

The component has no events.

A descriptive source file for this component is install dir/netscape/peas/DBPool.jsb

Properties

LiveWire DBPool  
Property Description
Database Name

The name of the database.

Property name: dbName

Value type: string

Database Server

The name of the database server.

Property name: dbServer

Value type: string

Database Type

The database type.

Property name: dbType

Value type: string (ORACLE, Personal Oracle Lite, INFORMIX, SYBASE, DB2, ODBC-SQL Anywhere, ODBC-SQL Server, ODBC-other)

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Max. Connections

Maximum number of database connections to cache (ES 3.0 only). Default value is 2.

Property name: maxConnections

Value type: number

Password

The run-time password on the database server.

Property name: password

Value type: string

TimeoutInterval (ES 3.0 only)

Timeout interval to wait for available connection, in seconds. Default value is 30.

Property name: timeout

Value type: number

Transaction Mode (ES 3.0 only)

Commit or roll back open transactions on connection release. Default value is rollback.

Property name: transactionMode

Value type: string (commit, rollback)

User Name

The run-time user name on the database server.

Property name: userName

Value type: string

Methods

LiveWire DBPool  
Method Description
connect

Connects the pool to a particular configuration of database and user.

Arguments: dbType (string), dbServer (string),
userName (string), password (string),
dbName (string),
maxConnections (number),
autoCommit (string)

Return value: none

connected

Tests whether the database pool and all of its connections are connected to a database.

Arguments: none

Return value: connected (boolean)

connection

Retrieves an available connection from the pool.

Arguments: name (string), timeout (number)

Return value: success (boolean)

disconnect

Disconnects all connections in the pool from the database.

Arguments: none

Return value: none

Mail-to Link

The Mail-to Link is a client-side JavaScript HTML link component that creates a link used for sending messages. When clicked, this link displays the mail composition window. You can set the properties to values that will be automatically filled in as defaults for the mail message. Note that the message is not actually sent until the user clicks Send in the mail window.

The component has no events and no methods.

A descriptive source file for this component is install dir/netscape/peas/MailToLink.jsb

Properties

Mail-to Link  
Property Description
Addressee (to)

Comma-delimited list of email addresses that will receive the message.

Property name: to

Value type: string

Blind Copies (bcc)

Comma-delimited list of recipients not shown in the message.

Property name: bcc

Value type: string

Body

Body of the mail message.

Property name: body

Value type: string

Copies (cc)

Comma-delimited list of email addresses that will receive copies of the message.

Property name: cc

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Subject

Subject of the mail message.

Property name: subject

Value type: string

Text

Text to be displayed in hyperlink.

Property name: text

Value type: string

Scrolling Message

The Scrolling Message is a client-side JavaScript component that displays a scrolling message in the Navigator status bar (at the bottom of the window) when its scroll method is called.

The component has no events.

A descriptive source file for this component is install dir/netscape/peas/ScrollingBanner.jsb

Properties

Scrolling Message  
Property Description
ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Message

The text message that is displayed in the status bar.

Property name: msg

Value type: string

Scroll Speed

The scrolling speed. Lower numbers represent slower speeds. When the value is 0, the message does not scroll.

Property name: speed

Value type: number

Start Position

The position where the message begins, expressed as offset in characters from the left edge of the window.

Property name: position

Value type: number

Methods

Scrolling Message  
Method Description
reset

Restores the message to its starting position.

Arguments: none

Return value: none

scroll

Begins scrolling the message.

Arguments: none

Return value: none

stop

Stops scrolling the message.

Arguments: none

Return value: none

Server Label

The Server Label is a server-side JavaScript component for displaying a single item of information, for example, the value of a database field or the results of an aggregate function in an SQL query, such as a sum, maximum, or minimum. The properties determine the format for the text.

The component has no events and no methods.

A descriptive source file for this component is install dir/netscape/peas/Label.jsb

Properties

Server Label  
Property Description
Bold

When set to true, displays text in boldface.

Property name: bold

Value type: boolean

Font

List of fonts. Uses the first font available in list.

Property name: fontFace

Value type: string

Font Color

Color in which to display value. The color is expressed as a color name or an RGB hex triplet.

Property name: fontColor

Value type: color

Font Size

Size of font in which to display text (1 through 7).

Property name: fontSize

Value type: number (1:7)

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Italic

When set to true, displays text in italics. Default value is false.

Property name: italic

Value type: boolean

Name

The name of the component.

Property name: name

Value type: string

Underline

When set to true, displays text underlined. Default value is false.

Property name: underline

Value type: boolean

Value

Text value for label, or JavaScript expression from which to derive label text, for example, project.idNo. Default value is 0.

Property name: value

Value type: string

Server Send Mail

The Server Send Mail is a server-side JavaScript component that creates a mail message on the server and sends it. This component is not visible in the end-user interface.

You can put this component on a page by itself (or with explanatory text). When you set the Send Now? property to true, the message is sent as soon as the page is loaded. Alternatively, you can put the component on the same page as the calling component, and when any conditions are met, call the send method to send the message.

The From Address and To Address properties must be set for the message to be sent successfully.

The component has no events.

A descriptive source file for this component is install dir/netscape/peas/SendMail.jsb

Properties

Server Send Mail  
Property Description
Blind Copies To

A comma-delimited list of email addresses to which to send blind copies.

Property name: bcc

Value type: string

Copies To

A comma-delimited list of email address to which to send copies.

Property name: cc

Value type: string

Errors To

Email address to which to send errors.

Property name: errorsTo

Value type: string

From Address

Email address of sender. Required.

Property name: fromAddress

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Message Body

Body of message.

Property name: body

Value type: string

Organization

Organization name for message header.

Property name: organization

Value type: string

Reply To

Email address to reply to, if different from that of the sender.

Property name: replyTo

Value type: string

Send Now?

When set to true, the mail message is sent as soon as the page is loaded and the script is processed on the server. When set to false, the message is not sent until the component's send method is called. (For example, if you want to send the message based on some condition to be determined elsewhere in the page, set SendNow? to false.)

Note that the scope of this component is the containing page, and thus it must be sent in a script on the same page in which it is instantiated.

Default value is true.

Property name: sendNow

Value type: boolean

SMTP Server

Name of the mail (SMTP) server to use. If not specified, defaults to the setting on the admin server.

Property name: smtpServer

Value type: string

Subject

Subject of mail message.

Property name: subject

Value type: string

Success Message

An HTML string to be displayed when the message is sent successfully. Default value is Message Sent Successfully.

Property name: successMsg

Value type: string

To Address

A comma-delimited list of email addresses of recipients. Required.

Property name: toAddress

Value type: string

Methods

Server Send Mail  
Method Description
errorCode

Displays an error code.

Arguments: none

Return value: error (number)

errorMessage

Displays an error message.

Arguments: none

Return value: none

send

Sends the mail message.

Arguments: none

Return value: none

Simple Server Table

The Simple Server Table is a server-side JavaScript component that creates an HTML table. The table automatically displays data retrieved by the specified SQL Query, through the specified LiveWire DBPool component. The data is only displayed. You cannot use this component to update data in the database.

Because the Connection Builder makes only client-side connections, you cannot connect the Simple Server Table component directly to a cursor component. The data is obtained through the referenced LiveWire DBPool component using the SQL select statement specified in the component's SQL Query property.

The component has no events and no methods.

A descriptive source file for this component is install dir/netscape/peas/SimpleTable.jsb

Properties

Simple Server Table  
Property Description
DBPool

Name of the LiveWire DBPool component from which to get the database connection.

Property name: dbpool

Value type: DBPool

Detail Column

Name of the column linked to by the master query (if any).

Property name: detailColumn.

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

SQL Query

SQL select statement that retrieves data to display.

Property name: SQL

Value type: SQLQuery

Validated Form

The Validated Form is a client-side JavaScript component that generates an HTML form which can contain Validated Text Fields. The values in the Validated Text Fields are validated when the user submits the form. Validated Text Fields must be on a Validated Form for validation to occur.

This is a Palette component that consists of an HTML form with an event script added. The properties and events are the same as those for the standard HTML Form component. The onSubmit event automatically has one connection to a script that checks the validity of field values when the form is submitted. The script checks that each field in the form has a valid value and that each required field has a non-null value.

A descriptive source file for this component is install dir/palettes/ValidatedForm_pe.html

Properties

Validated Form  
Property Description
Action

Specifies the URL to which the form is to be submitted. This can be an absolute URL, or relative to the page containing the component.

Property name: action

Value type: string

Encoding

Specifies the encoding method used for form data.

Property name: enctype

Value type: string (application/x-www-form-urlencoded, multipart/form-data)

Method

Specifies the technique for submitting the form. When set to POST, the component contacts the URL specified in the Action property, then sends the form values in a separate transmission. When set to GET, form values are URL encoded and sent in a single transmission to the URL specified in the Action property. Must be GET for use with the Database Form Handler component.

Property name: method

Value type: string (GET, POST)

Name

The name of the component.

Property name: name

Value type: string

Target

Specifies the name of the frame or window in which the results of submitting a form should be displayed. If not specified, the current window or frame is used.

Property name: target

Value type: string

Methods

Validated Form  
Method Description
reset

Resets each of the input elements of the form to their default values.

Arguments: none

Return value: none

submit

Submits the form to the URL specified in the Action property, by the method specified in the Method property.

Arguments: none

Return value: none

Events

Validated Form  
Event Description
onReset

Occurs just before the elements of the form are reset.

onSubmit

Occurs just before the form is submitted.

Validated Text Field

The Validated Text Field is a client-side JavaScript text field element in a Validated Form component. The value of the text field is validated according to the specified criteria. Validation can occur when the field value changes, or when the form is submitted, or at both times.

A descriptive source file for this component is install dir/netscape/peas/ValidatedText.jsb

Properties

Validated Text Field  
Property Description
Error Message

A text message to be displayed in an alert popup dialog box when validation fails.

Property name: errorMessage

Value type: string

ID of Component

A unique JavaScript identifier for the component.

Property name: ID

Value type: string

Size

The number of characters displayed in the text field. Default value is 0.

Property name: size

Value type: number

Validate On Change

When set to true, evaluates the validation expression when the field's value changes. Default value is false.

Property name: validateOnChange

Value type: boolean

Validate On Submit

When set to true, evaluates the validation expression when the form is submitted. Default value is false.

Property name: validateOnSubmit

Value type: boolean

Validation Expression

A JavaScript expression to evaluate whenever validation occurs. If the expression evaluates to true, then the field is validated. Otherwise, it is not validated and the error message is displayed.

Property name: expression

Value type: string

Value

The value of the field, by default. Use the getValue method to retrieve the value, and the setValue method to change it.

Property name: value

Value type: string

Value Is Required

When set to true, a value is required in this field. When the form containing this field is submitted, a check is performed to determine that this field has a non-null value. Default value is false.

Property name: isRequired

Value type: boolean

Methods

Validated Text Field  
Method Description
blur

Removes keyboard focus from the text element.

Arguments: none

Return value: none

focus

Gives keyboard focus to the text element.

Arguments: none

Return value: none

getValue

Retrieves the current value of the text box.

Arguments: none

Return value: value (string)

select

Selects the current text in the text element.

Arguments: none

Return value: none

setValue

Sets the value of the text box.

Arguments: newValue (string)

Return value: none

validate

Initiates validation of the current value. Returns true if the value is valid, false otherwise.

Arguments: none

Return value: valid (boolean)

Events

Validated Text Field  
Event Description
onBlur

Occurs when the field loses keyboard focus.

onChange

Occurs when the user changes the text.

onFocus

Occurs when the field is given keyboard focus.

onSelect

Occurs when the text is selected.

property value change

Occurs when the Value property changes.


[Contents] [Previous] [Next] [Last]

Last Updated: 11/19/97 12:45:30


Copyright © 1997 Netscape Communications Corporation