Progress
Programming
Handbook


Defining an Updatable Browse

An updatable browse supports in-line editing of data. The code example below shows the syntax for enabling a single field in the browse for input:

p-br02.p
DEFINE QUERY q1 FOR customer SCROLLING. 
DEFINE BROWSE b1 QUERY q1 DISPLAY cust-num name credit-limit balance 
    ENABLE credit-limit WITH 10 DOWN SEPARATORS  
    TITLE "Update Credit Limits". 
DEFINE FRAME f1 
    b1 
        WITH SIDE-LABELS ROW 2 CENTERED NO-BOX.  
OPEN QUERY q1 FOR EACH customer NO-LOCK. 
ENABLE ALL WITH FRAME f1. 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

When you run this example, the following browse appears:

Notice that the updatable browse has row markers on the left. In a read-only browse, clicking anywhere in a row selects the row. In an updatable browse, clicking in a row is interpreted as a request to edit that field, if the field is enabled. Otherwise, the row is selected. The normal way to select rows in an updatable browse is to select row markers. (Note that row markers can also be turned off programmatically with the NO–ROW–MARKERS option of the DEFINE BROWSE statement.)

NOTE: In character interfaces, a key sequence (ESCR) toggles between two modes, to select rows or edit cells. By default, the selected row is the highlighted row that you change with CURSORDOWN and CURSORUP. Character row markers appear as an asterisk (*).

An instance of a field in a row (the intersection of a row and column) is called a browse cell. An updatable browse cell behaves in much the same manner as a fill-in field. Tabbing or clicking moves the user from one updatable cell to the next.

NOTE: In character interfaces, the EDITOR–TAB and BACK–TAB key functions (usually CTRLG and CTRLU) tab from cell to cell.

One very important fact to remember is that a read-only browse cannot be enabled, or “turned on,” by the programmer after it has been defined. If you expect to need any of the capabilities of the updatable browser, enable the appropriate fields in the definition and then use the READ–ONLY attribute to temporarily turn them off.

The SEPARATORS option provides dividers between columns and rows. Using separators with an updatable browse makes the browse look more like a spreadsheet, which might suggest that it has inline editing capability to the user.

NOTE: The difference in behavior between read-only and updatable multiple-select browse widgets represents a commitment to backward compatibility on one hand and a commitment to supporting native standards on the other.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095