Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    4

    Unanswered: Simple Forms navigation issue.

    I'm working with Oracle 8i and Forms 6i. Haven't worked in Forms for awhile and have a simple navigation issue that i can't resolve simply.

    I have one simple multi-record block which displays 15 records. Upon navigation to a particular record (say record #4), i have the ability to click on any of various buttons below that lead me to different forms. This all works well.

    However, after those forms listed previously are accessed, control is returned to the calling form and the block is re-queried (changes might have been made to a couple of attributes by the called screen). My problem is that the record focus returns to the first record in the block, and i want to return the cursor to the same record that i was in when i pressed one of the buttons (record #4 in my example).

    Basically, i want to retain some memory of where i was in the multi-record block so that i can return to the same record after the block is re-queried.

    Pretty simple problem, just have forgotten how to do this. I appreciate the help!
    thanx!

  2. #2
    Join Date
    Mar 2004
    Location
    Chennai, India
    Posts
    18
    A simple suggestion that I could think of is, say you are traversing the multi-record datablock using a for loop then you can store the count or the iteration variable in a global variable and use this global vaiable again to go to the exact record where you were in when you changed screen. Hope this might be useful.
    Palaniappan.S
    Chennai.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    This code would be in the when_button_pressed trigger on the button.
    ---------------
    go_block('my_block');
    :global.current_record := ystem.Cursor_Record;
    ...
    ... do your processing, requery,... whatever.
    ...

    go_block('my_block');
    Go_Record(:global.current_record);
    erase('global.current_record');
    ---------------
    and if you really want to get fancy, try the following. It will return you to the specific item in the record you were on when you pressed the button.

    go_block('my_block');
    :global.current_record := ystem.Cursor_Record;
    :global.current_item := :system.cursor_item;
    ...
    ... do your processing, requery,... whatever.
    ...

    go_block('my_block');
    Go_Record(:global.current_record);
    go_item(:global.current_item);
    erase('global.current_record');
    erase('global.current_item');
    Last edited by beilstwh; 07-21-04 at 10:11.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Jul 2004
    Posts
    4

    Followup and additional info.

    Thank you for the suggestions! I have actually been trying things along these lines already, but i DO appreciate the input, it helped me to fix one of the two types of navigation issues that i was having. Please allow me to give further information....

    I have:
    My master block in the main form has 15 records. Below it is basically a "button block" which has say two buttons. Each of the buttons calls another form.

    Button A calls another form, where i can potentially make changes to the record and upon re-entry, re-queries the main form. Using the suggestions that you have given here, the navigation is working properly. Is the "best place" to set the global variable in a block-level trigger WHEN-RECORD-INSTANCE? That's what i've done, but i would appreciate feedback if there is a "better place".

    Button B calls another form which is a "detail form". No changes are made in the called form, and the master form is not requeried upon exiting the called form. I still have a problem retaining input focus here. The detail form is called in the following fashion in the WHEN-BUTTON-PRESSED trigger for Button B in the "button block".
    Open_Form('detail_form', activate, no_session, parameter_list);

    The problem is that once the detail form is closed, any code after the OPEN_FORM call in the WHEN-BUTTON-PRESSED trigger does not execute.
    I'm not completely sure why this happens, but i need to get past it.
    Thus, when the master form regains focus, the focus is back on the button that I just pushed in the "button block". What i need to understand and implement is:

    Where to put the necessary navigation code to navigate from the "button block" back to the master block, get back to the original record that i was in (i think that's covered in what i learned above) and finally, to return input focus to a particular field.

    thank you for any help or insight that you can offer!
    jim.

  5. #5
    Join Date
    Apr 2004
    Posts
    246
    If you set mouse and keyboard navigate to off for the buttons, then focus cannot remain on the button after it is pressed. Also, make the buttons part of the multi-record block, setting displayed records =1, this way you're jumping between blocks, so the form doesn't forget which record you were on.
    Give a man a fish, you feed him for a day. Club him over the head with a fish, he'll leave you alone.

  6. #6
    Join Date
    Oct 2003
    Posts
    232

    Arrow think about this

    Under when_button_press

    use open_form or call_form one of the 2 ; instead of go_block


    i dont have the form installed otherwise i would have checked
    bigfoots

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •