Problem: "rowfocuschanged!" during dw.retrieve()

Problem: "rowfocuschanged!" during dw.retrieve()

Post by Q Vincent Y » Tue, 28 Nov 1995 04:00:00



dw.retrieve() will eventually trigger a RowFocusChanged event.  In PB4,
it seems that RowFocusChanged is triggered as soon as one screenful
of rows are retrieved.  Then after RowFocusChanged, the rest of the rows
(which are not visible on the screen) will be retrieved.

That causes a problem because at the time RowFocusChanged is triggered,
there're still those to-be-retrieved rows pending in result set.  Any
databases access in the RowFocusChanged will give the following error:
        DataWindow Error:
        Only Cancel command is validwhen records are prending

If the entire result set is less than one screeful, then the error will
not occur.  I easily tested it by resizing the dw at runtime.  Everytime
I decrease the height of dw so that the result set is more than one screenful,
the error occurs when retrieve().

Anyone know about that problem?

--

Q Vincent Yin                   |       Repeat

                                |       Until 0 = 1;

 
 
 

Problem: "rowfocuschanged!" during dw.retrieve()

Post by Ahmad Ghoshe » Tue, 28 Nov 1995 04:00:00


I suggest you move your code to the retrieveend event. In the retrieveend
event set an instance flag to true to indicate that the retrieve is complete.
In the RowFocusChanged event check for the flag. If false then return else
continue. It is not pretty, but it is a work around
--
Ahmad Ghosheh                
PowerDesign
The PowerBuilder Experts
Kansas City, MO              


 
 
 

Problem: "rowfocuschanged!" during dw.retrieve()

Post by B. Samuel Blancha » Wed, 29 Nov 1995 04:00:00




Quote:>That causes a problem because at the time RowFocusChanged is triggered,
>there're still those to-be-retrieved rows pending in result set.  Any
>databases access in the RowFocusChanged will give the following error:

Utilize an additional transaction object. You will then have an additional
connection to the database which can function independently.  Let me
know if you need a reference to the proper manual or books.

Sam Blanchard