Consultor Eletrônico



Kbase 20882: How To Force a Browse to Display First Column on Query Reopen?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How To Force a Browse to Display First Column on Query Reopen?

FACT(s) (Environment):

Progress 9.X

CAUSE:

The behavior of the browse has changed in Progress Version 9.x from its former behavior in Version 8.x. Specifically, where the Version 8.3B browse displayed its contents beginning at column one, row one at the reopening of the query of the browse, the Version 9.x browse reverts to the current column and row one.
Thus if your left-most column is for example, column number 7 before you reopen the query, the version 9.x browse refresh displays it's contents starting at first row and column 7.

The solution provided below might be helpful if you are migrating from Version 8.x to 9.x and want to preserve the old Version 8.x behavior of the browse.

FIX:

This solution assumes you are connected to the Progress Sports database and that you have a regular window that contains a regular browse that is based on the customer table.

It is further assumed that the browse includes more fields and records than the view port can accommodate, therefore it has both a horizontal and vertical scroll bar.

NOTE: The code example below is for informational purposes only. It makes use of the browse FIRST-COLUMN attribute as well as the browse "CURSOR-LEFT" event.

Follow these steps:

1) Drop a button on the window and add the code necessary to reopen the browse query to the button CHOOSE event:

DO:
{&OPEN-QUERY-{&BROWSE-NAME}}
END.

2) Run the application under Version 9.x.

3) Navigate using the vertical and horizontal scroll bars to some location in the browse so that the first column is out of the view port.

4) Click the button to reopen the query.

Notice that the browse refreshes to display row one, but fails to reposition to column one.

To force the browse to reposition after reopening its query to column one and row one, modify the button CHOOSE trigger to read as follows:

DO:
DEFINE VARIABLE iCounter AS INTEGER NO-UNDO.

DO iCounter = 1 TO {&BROWSE-NAME}:NUM-COLUMNS:
APPLY 'cursor-left' TO {&BROWSE-NAME}.
END.
{&OPEN-QUERY-{&BROWSE-NAME}}
END.