Programming Guide



CLEAR

Clears data in widgets

int sm_tm_command ("CLEAR [ tableViewName [ tableViewScope ] ]");

Arguments

tableViewName
The name of a table view in the current transaction. This parameter is case sensitive.

If tableViewName is specified, the command is applied according to the tableViewScope parameter. Since the entire table view tree might not be included, this is known as a partial command, and sm_tm_command sets TM_FULL to 0.

If tableViewName is not specified, the command is applied for each table/server view, starting with the root table view. This is known as a full command, and sm_tm_command sets TM_FULL to 1.

tableViewScope
One of the following parameters, which must be preceded by a table view name. TV_AND_BELOW which applies the command to the specified table view and all table views below it on the tree. If no parameter is specified, the transaction manager acts as though TV_AND_BELOW was supplied. BELOW_TV which applies the command to the table views below the specified table view. TV_ONLY which applies the command to the specified table view only. SV_ONLY which applies the command only to the table views of the specified server view.

Description

CLEAR clears the data displayed on the screen for any widget belonging to a valid table view. CLEAR has two major uses:

In order to delete rows from the database, the table view must be updatable. If the table view is non-updatable, the data is cleared from the screen, but SQL DELETE statements are not issued.

The CLEAR command does not change the transaction mode.

Push buttons and menu selections for the CLEAR command can choose to set the class property to clear_button. By default, clear_button is active in all transaction modes.

Sequence

To delete rows, CLEAR must be followed by the SAVE command.

To perform a query-by-example, execute CLEAR before entering a value for the SELECT or VIEW commands.

Events

The following request events can be generated by the CLEAR command to ascertain whether the changes from the previous command have been saved and, if desired, discard those changes:

Table 8-4 Request events for CLEAR

Request Traversal Typical Processing

TM_PRE_CLOSE

Described under CLOSE

TM_CLOSE

Described under CLOSE

TM_QUERY

Described under CLOSE

TM_DISCARD

Described under CLOSE

TM_POST_CLOSE

Described under CLOSE

TM_PRE_CLEAR

By table/server view from the specified table view

Do nothing

TM_CLEAR

By table/server view from the specified table view

Do nothing (sm_tm_clear is called for the table view by the transaction manager after this request)

TM_POST_CLEAR

By table/server view from the specified table view

Do nothing