Kbase 16271: Programmatical way of disabling AUTO-ZAP on updatable browse
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Programmatical way of disabling AUTO-ZAP on updatable browse
This Knowledge Base entry will supply a way to circumvent a
feature of the updatable browser. The feature is that when one
uses the TAB key to go through the fields and columns of a
browser, the content of the field that is entered will allways
be entirely selected (note the selection color).
This is called the AUTO-ZAP feature, which will ensure that the
moment you start typing something in the fill-in of the browser
the original value is immediately replaced by what one types in.
One might want to have this AUTO-ZAP feature turned off, because
this is unwanted behaviour. To accomplish this one will have to
implement the following pieces of code. The example will only
turn the AUTO-ZAP feature off for one (in this case the middle)
column, to show that a combination of the on/off mode of the
feature can be used in one browser as well.
For the example (against the sports database) to work do the
following:
- Create a new window
- Drop a (normal) browser in the created window
- In the Query Builder choose Customer as table to use
- In the Column Editor choose fields Cust-num, Name, City and
Country
- Make fields Name, City and Country updatable by double-clicking
on them
On the CURSOR-DOWN trigger of City enter:
APPLY 'CURSOR-DOWN' TO SELF.
SELF:AUTO-ZAP = FALSE.
RETURN NO-APPLY.
On the CURSOR-UP trigger of City enter:
APPLY 'CURSOR-UP' TO SELF.
SELF:AUTO-ZAP = FALSE.
RETURN NO-APPLY.
On the ENTRY trigger of City enter:
IF KEYFUNCTION(LASTKEY) <> "CURSOR-DOWN" AND
KEYFUNCTION(LASTKEY) <> "CURSOR-UP" THEN DO:
APPLY 'ENTRY' TO SELF.
SELF:AUTO-ZAP = FALSE.
RETURN NO-APPLY.
END.
Now run the procedure and TAB through the browser or use the
CURSOR-UP and CURSOR-DOWN keys in the column for City to see
the desired behaviour.
Progress Software Technical Support Note # 16271