GetText

Description

Obtains the value in the edit control over the current row and column. When the user changes a value in a DataWindow, it is available in the edit control before it is accepted into the column.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object


Syntax

PowerBuilder

string dwcontrol.GetText ( )

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow


Return value

Returns the value in the edit control over the current row and column in  dwcontrol. The value might or might not have been accepted into the row and column. Returns the empty string (" ") if no column is currently selected in dwcontrol.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

The values in the rows and columns of a DataWindow are items in the DataWindow's buffer. When a user edits a value in a row and column, the item value is transferred as text to an edit control in which the user can change the value. When the user leaves the column or when a script calls AcceptText, the text in the edit control is accepted into the column and becomes the value of the item in the buffer.

You do not need to call GetText in the script for the ItemChanged or ItemError event. To check the value entered in the edit control over the current row and column before allowing it to be accepted into the column, use the data argument.

To obtain the value stored in the DataWindow's buffer for the row and column, use the GetItem method that corresponds with the datatype of the column.

Examples

This statement returns the text held in the edit control for the currently selected cell in dwEmp to the string variable selectedCell. The text might be a name or address for a column with the Edit edit style, Y or N for a column with the CheckBox edit style, or A, T, or L for a column with the RadioButtons edit style that represents the employment status:

string selectedCell
selectedCell = dwEmp.GetText()

See also

SetText