Consultor Eletrônico



Kbase 15296: An example of How to Update Browse Data in V7
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
An example of How to Update Browse Data in V7

INTRODUCTION
============
This knowledgebase describes one way to update browse data in PROGRESS
Version 7. In PROGRESS Version 8, this method can be replaced with
updateable browse functionality.

PROCEDURAL APPROACH
===================
Create a trigger for the default-action event of the browse widget.
Within the trigger code, define a buffer for the table and use that
buffer to find the record the user has chosen with an exclusive lock.
Then update the appropriate fields with a dialog box and use the
browse refresh method to refresh the display of the current rows in
the browse.

CODE EXAMPLE
============
The following code example demonstrates this functionality with the
sports database:

define var changes-made as logical no-undo.

define query cust-qry for customer.
define browse cust-browse query cust-qry
display customer.cust-num customer.name with 10 down.

define frame brws-frame
cust-browse with centered.

on default-action of cust-browse in frame brws-frame do:
define buffer cust-buffer for customer.
find cust-buffer where recid(cust-buffer) = recid(customer)
exclusive-lock.
update customer.cust-num customer.name with frame upd-cust
view-as dialog-box title "Customer Update".
changes-made = cust-browse:refresh().
end. /* on default-action event */

open query cust-qry for each customer.
enable cust-browse with frame brws-frame.
wait-for window-close of current-window.

REFERENCES TO WRITTEN DOCUMENTATION
===================================
Chapter 10 of PROGRESS Programming Handbook - Transactions
Appendix B of PROGRESS Language Reference - Methods

Progress Software Technical Support Note # 15296