ItemFocusChanged

Description

Occurs when the current item in the control changes.

PowerBuilder event information

Event ID: pbm_dwnitemchangefocus

Argument

Description

row

Long by value. The number of the row containing the item that just gained focus.

dwo

DWObject by value. A reference to the column containing the item.


Return Values

There are no special outcomes for this event. The only code is:

0 -- Continue processing

Usage

ItemFocusChanged occurs when focus is set to another column in the DataWindow, including when the DataWindow is first displayed.

The row and column together uniquely identify an item in the DataWindow.

PowerBuilder programming note

In the ItemFocusChanged event, dwo is always a column control. Therefore, you can get more information about it by examining any properties that are appropriate for columns such as dwo.id and dwo.Name.

Examples

This example reports the row and column that just gained focus and that just lost focus. (The first time the event occurs, there is no item that just lost focus; the script saves the row number and column name in two instance variables called ii_row and is_colname so that the old item is known the next time the event occurs.)

IF ii_row > 0 THEN
      sle_olditem.Text = "Old row: " + String(ii_row) &
      + " Old column: " + is_colname
END IF
 
sle_newitem.Text = "New row: " + String(row) &
      + " New column: " + dwo.Name
 
// Replace values of instance variables
// with info for next change in focus
ii_row = row
 
is_colname = dwo.Name

See also

RowFocusChanged

RowFocusChanging