Consultor Eletrônico



Kbase P7944: Resizing a browse or it's columns while its associated query is open changes the current record of i
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/19/2008
Status: Verified

SYMPTOM(s):

Resizing a browse or it's columns while its associated query is open changes the current record of its query while the focussed row remains where it was.

Buffer points to the record displayed in the new bottom row of the browse

Browse is being resized in a way that more records are now displayed

No record is available in buffer if bottom row is blank

FACT(s) (Environment):

Reducing the width of a browse column can cause horizontal scrollbar to be removed, which allows more rows to be displayed
Increasing the width of the browse can also cause horizontal scrollbar to be removed, which allows more rows to be displayed
Increasing the size of the browse vertically allows more rows to be displayed
Progress 9.1x
Windows

CAUSE:

Bug# OE00077327

CAUSE:

When the resize action causes the browser to display additional records, this changes the contents of the buffers associated with the browser. Display of one or more additional *empty* browser rows will clear the buffers.

FIX:

Upgrade to OpenEdge 10.0A or later release.

Possible workarounds:

DEFINE VARIABLE r AS ROWID NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.

IF AVAIL customer THEN r = ROWID(customer).

i = br:FOCUSED-ROW.
[Change the size of the browse here]

/* Work Around 1 */
/* Does not fires any ENTRY trigger and might be quicker but the browse needs to be sensitive. */
DEFINE VARIABLE h AS HANDLE NO-UNDO.
h = FOCUS:HANDLE.
APPLY 'FOCUS' TO br.
APPLY 'FOCUS' TO h.

/* Work around 2 */
/* Requires to take care about the repositioned-row if we do not want the browse to scroll. */
br:SET-REPOSITIONED-ROW(i,"CONDITIONAL").
IF r <> ? THEN REPOSITION br TO ROWID r.

/* Work around 3 */
/* Re-find the current records by using the SELECT-FOCUSED-ROW method after resizing.*/

ON 'end-resize':U ANYWHERE
DO:
DEFINE VARIABLE h AS HANDLE NO-UNDO.
h = SELF:PARENT.
IF h:TYPE = 'BROWSE' AND h:NUM-SELECTED-ROWS > 0 THEN
h:fetch-selected-row(1).
END.