Re: Forms problem

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/06/27
Message-ID: <sliqkmukjev32_at_corp.supernews.com>#1/1


[Quoted] "deval" <japs1_at_my-deja.com> wrote in message news:8jbdj1$5s4$1_at_nnrp1.deja.com...
> I am using Forms 4.5 and was wondering if there is a way to re-query a
> multi-row, tabular block without losing the place of the cursor.
>
> If the user is on say the 100th row in the block, and hits the "re-
> query" button (which is just an EXECUTE_QUERY) the focus moves to the
> first record in the block. This is not the desired result, i'd rather
> the cursor stayed on the record the user was on before just before the
> re-query was hit.
>
> Does anyone have any solutions to this problem???
>
> Is there a better way of achieving what I am trying to do?

[Quoted] Easy. Create a control block item (not in the same block) and on KEY-EXEQRY of [Quoted] [Quoted] the queryable block (but before the block clears), populate that control item with the record number:

:CONTROL_BLOCK.REC_NUM := :SYSTEM.CURSOR_RECORD; [Quoted] [Quoted] On PRE-QUERY of the queryable block, reset a counter variable (you'll see why [Quoted] you'll need this in a moment)

:CONTROL_BLOCK.RECORDS_FETCHED := 0; [Quoted] Track the new records via POST-QUERY (you'll see why in a moment) of the queryable block:

[Quoted] :CONTROL_BLOCK.RECORDS_FETCHED := CONTROL_BLOCK.RECORDS_FETCHED + 1; [Quoted] [Quoted] Then, after the actual EXECUTE_QUERY call in KEY-EXEQRY, move the user there:

SYNCHRONIZE;
IF :SYSTEM.MODE = 'NORMAL' AND
  :CONTROL_BLOCK.RECORDS_FETCHED >= :CONTROL_BLOCK.REC_NUM AND   :SYSTEM.CURSOR_RECORD != :CONTROL_BLOCK.REC_NUM THEN   GO_RECORD(:CONTROL_BLOCK.REC_NUM);
  IF FORM_SUCCESS THEN
    :CONTROL_BLOCK.REC_NUM = 1;
    :CONTROL_BLOCK.RECORDS_FETCHED := 0;   ELSE
    RAISE_FORM_TRIGGER_FAILURE;
  END IF;
END IF; [Quoted] [Quoted] I think :SYSTEM.MODE = 'NORMAL' is what you want to evaluate (you want [Quoted] POST-QUERY to finish firing before you do the moving). I remember there's [Quoted] [Quoted] 'NORMAL','ENTER-QUERY', and there's one other status IIRC that represents the [Quoted] [Quoted] "working" state (while the query is processing). Check the online help for the [Quoted] SYSTEM.MODE variable - I can't remember offhand what that third status is.

-Matt Received on Tue Jun 27 2000 - 00:00:00 CEST

Original text of this message