Kbase P138584: Navigation Panel and SmartDataViewer are not updated after delete
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/02/2009 |
|
Status: Unverified
SYMPTOM(s):
Navigation Panel and SmartDataViewer are not updated after delete
FACT(s) (Environment):
There is only two records
If the first record is deleted, it still appears available
If the second record is deleted, the problem does not occur
The navigation panel still works like if the deleted record was still existing
If the "Last" button of the navigation panel is pressed or the window is closed and opened again, the problem does not occur
Windows
OpenEdge 10.1x
CAUSE:
Bug# OE00178238
CAUSE:
The data.p call fetchNext when the first record is deleted.
FIX:
There are two possible workarounds:
Alternative 1: override deleteRow in a customdata class. (variable definitions not shown)
-----------
cQpos = {fn getQueryPosition}.
lok = super(pcRowident).
if cQpos = "firstRecord" then
run fetchFirst.
return lok.
-----------
Alternative 2: fix in data.p deleteRow
-----------
<defs skipped>
def var lFirstdeleted as log no-undo. /* FIX - step 1 of 3 */
<lines skipped>..
./* We deleted the first of the batch */
IF cFirstResult = ? THEN
DO:
IF NOT hRowObject:AVAIL THEN
hDataQuery:GET-FIRST.
/* This must now be the first record, unless it is new */
IF hRowObject:AVAIL AND hRowIdent:BUFFER-VALUE > '':U THEN
DO:
lFirstDeleted = true. /* FIX - step 2 of 3 */
cFirstResult = hRowNum:BUFFER-VALUE + ';':U +
hRowIdent:BUFFER-VALUE.
{set FirstResultRow cFirstResult}.
END.
END.
<lines skipped>
/* NextNeeded = false if the browse 'autopositioned', also if we
deleted
the first, only or last record don't try to fetch another batch.
*/
IF lNextNeeded AND {fnarg rowAvailable 'NEXT':U} AND NOT
lFirstDeleted
AND NOT lNewDeleted /* FIX step 3 of 3 */ THEN
RUN fetchNext IN TARGET-PROCEDURE.
ELSE
DO:
RUN updateQueryPosition IN TARGET-PROCEDURE.
PUBLISH 'dataAvailable':U FROM TARGET-PROCEDURE ('different':U).
{set NewBatchInfo '':U}.
END.
-----------