ReselectRow method (DataWindows)
Description
Accesses the database to retrieve values for all columns that
can be updated and refreshes all timestamp columns in a row in a
DataWindow control or DataStore. The values from the database are
redisplayed in the row.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
integer <span>dwcontrol</span>.<span>ReselectRow</span> ( long <span>row</span> ) |
[Web DataWindow server component]
1 |
short <span>dwcontrol</span>.<span>ReselectRow</span> ( long <span>row</span> ) |
[Web ActiveX]
1 |
number <span>dwcontrol</span>.<span>ReselectRow</span> ( number <span>row</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to the DataWindow control, |
row |
A value identifying the row to reselect |
Return Values
Returns 1 if it is successful and –1 if the row cannot
be reselected (for example, the DataWindow object cannot be updated
or the row was deleted by another user).
If any argument’s value is null, in PowerBuilder
and JavaScript the method returns null.
Usage
ReselectRow is supported for SQLSelect DataWindows. Use ReselectRow to
discard values the user changed and replace them with values from
the database after an update fails (due to a concurrent access error,
for example).
Timestamp support is not available in all DBMSs. For information
on timestamp columns, see the documentation for your DBMS.
If you are using ShareData and then use ReselectRow
on the primary DataWindow, the secondary DataWindow resets back
to row 1, column 1.
Examples
This statement reselects row 5 in the DataWindow
control dw_emp:
1 |
dw_emp.<span>ReselectRow</span>(5) |
This statement reselects the clicked row if the update
is not successful:
1 |
IF dw_emp.Update( ) < 0 THEN |
1 |
dw_emp.<span>ReselectRow</span>(dw_emp.GetClickedRow()) |
1 |
END IF |