Home » Developer & Programmer » Forms » How to reload a calling form after closing the called form?
How to reload a calling form after closing the called form? [message #251585] Sun, 15 July 2007 02:54 Go to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
I have FORM_A calling FORM_B: Call_form('FORM_B',...). On form_B I am updating a Record and when I close Form_B and the focus goes back to Form_A, I need to Automatically Reload Form_A to reflect the changes that were made on Form_B.

How can I reload the Calling Form (FORM_A) when I closed the called form (FORM_B)?

Re: How to reload a calling form after closing the called form? [message #251595 is a reply to message #251585] Sun, 15 July 2007 05:39 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
EXECUTE_QUERY on the block, perhaps? (following the CALL_FORM command)
Re: How to reload a calling form after closing the called form? [message #251596 is a reply to message #251595] Sun, 15 July 2007 05:54 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Hi Littlefoot,

I am not calling FORM_A from FORM_B. I am currently Only Closing FORM_B and automatically the focus goes back to form A with the OLD data.

Can you tell me how can I know in Form_A that I am back from B and I regained the focus then maybe I can call my WHEN-NEW-FORM-INSTANCE to reload the data?

Thanks in advance.
Baz

Re: How to reload a calling form after closing the called form? [message #251600 is a reply to message #251585] Sun, 15 July 2007 06:52 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

In form_M exit_from
:global.from_b := 'Y';

In form_A block instance
default_value('global.from_b', 'N'); --not sure of syntax
If :global.from_b = 'Y' Then
EXECUTE_QUERY;
:global.from_b := 'N';
End If;

Re: How to reload a calling form after closing the called form? [message #251601 is a reply to message #251596] Sun, 15 July 2007 06:53 Go to previous messageGo to next message
zameersait
Messages: 16
Registered: July 2007
Junior Member
You may user the trigger WHEN-FORM-NAVIGATE.
Re: How to reload a calling form after closing the called form? [message #251602 is a reply to message #251601] Sun, 15 July 2007 07:15 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Zameer,

As per the functionality description of the WHEN-FORM-NAVIGATE trigger provided by Oracle:

Quote:

Fires when navigation between forms takes place, such as when the user changes the focus to another loaded form.



the suggested trigger should do the job, so when I close FORM_B and I have set the above Trigger on FORM_A the Trigger should fire since the focus comes back to another loaded form. But still it doesn't seem to be working??

in the WHEN-FORM-NAVIGATE trigger I am trying to direct to WHEN-NEW-FORM-INSTANCE trigger in order to reload the form:

EXECUTE_TRIGGER('WHEN-NEW-FORM-INSTANCE');


Why is this not working?

Thanks
Re: How to reload a calling form after closing the called form? [message #251603 is a reply to message #251602] Sun, 15 July 2007 07:20 Go to previous messageGo to next message
zameersait
Messages: 16
Registered: July 2007
Junior Member
Hi,

Calling a oracle builtin trigger like u are trying wont do the job for u. You can copy the entire code in WHEN_NEW_FORM_INSTANCE in a procedure XYZ and call this procedure in both triggers WHEN-NEW-FORM-INSTANCE and WHEN-FORM-NAVIGATE.

Regards
Zameer
Re: How to reload a calling form after closing the called form? [message #251611 is a reply to message #251603] Sun, 15 July 2007 08:51 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
Thanks for the tip, I have already done what you recommended of calling a procedure that does the When-New-Form-Instance job,but I still have an issue that the WHEN-FORM-NAVIGATE trigger is not FIRING when I regain focus in FORM_A.

I am trying to display some messages in the Trigger and pausing but it doesn't seem that the Trigger is being triggered???

I tried Exiting Form B either by Exit_form or close_form and still the When-Form-navigate trigger in Form A is not Firing!!!

What could be the reason?

I appreciate your help.

Thanks,
Baz

Re: How to reload a calling form after closing the called form? [message #251631 is a reply to message #251611] Sun, 15 July 2007 14:36 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I still can't understand what's so complicated in this ... I created two test forms and called MODULE2 form from MODULE1 using the WHEN-BUTTON-PRESSED trigger which looks like this:
call_form('C:\Temp\module2');

go_block('dept');
execute_query;
and guess what? Changes I did in MODULE2 were perfectly visible in MODULE1.

Here are those two forms so - if you have a good, old Scott's schema, test it and see for yourself.

  • Attachment: MODULE1.fmb
    (Size: 40.00KB, Downloaded 1347 times)
  • Attachment: MODULE2.fmb
    (Size: 40.00KB, Downloaded 1315 times)
Re: How to reload a calling form after closing the called form? [message #251633 is a reply to message #251585] Sun, 15 July 2007 15:21 Go to previous messageGo to next message
zameersait
Messages: 16
Registered: July 2007
Junior Member
Hi,

I tried the same with couple of forms here and its working but it should maintain a sequence.So unless i have a broader picture of what u r trying to achieve i wont be able to provide u a solution.I would like to know how the Form A and Form B is called initially and how the focus goes to Form A automatically.

You may try out the solution above wincy has provided.

Thanks
Zameer
icon14.gif  Re: How to reload a calling form after closing the called form? [message #251706 is a reply to message #251633] Mon, 16 July 2007 02:46 Go to previous messageGo to next message
bbaz
Messages: 138
Registered: April 2007
Senior Member
SOLVED

Littlefoot, you are right the issue here is not complicated but the example you have provided (which definitely works in your case) is different from what I have. BUT THANKS FOR YOUR TIME AND FOR PROVIDING THE SAMPLE, YOU ARE ALWAYS HELPFUL IN YOUR POSTINGS.

I used a conditional WHEN-WINDOW-ACTIVATED trigger instead of When-Form-Navigate with the following code, similar to Wency's code (Thanks for the tip):

If :global.from_DETAIL = 'Y' Then
LOAD_MOVEMENTS();
:global.from_DETAIL := 'N';
End If;

setting global variable to 'Y' from the form I am leaving, and Initializing to 'N' on the return-to form.

WORKS PERFECTLY FINE Cool

All your support is appreciated.

Baz
Re: How to reload a calling form after closing the called form? [message #251781 is a reply to message #251706] Mon, 16 July 2007 11:28 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Great! I'm glad you found the solution.
Re: How to reload a calling form after closing the called form? [message #315018 is a reply to message #251781] Fri, 18 April 2008 12:12 Go to previous messageGo to next message
rajthampi
Messages: 28
Registered: December 2006
Location: Kuwait
Junior Member
Littlefoot wrote on Mon, 16 July 2007 19:28
Great! I'm glad you found the solution.

WHEN-FORM-NAVIGATE is still a mystery? after many hours of trials I also chose WHEN-WINDOW-ACTIVATED trigger to get my job done.
Curious still to know how I could get this WHEN-FORM-NAVIGATE trigger finally work Smile
Re: How to reload a calling form after closing the called form? [message #565178 is a reply to message #251585] Fri, 31 August 2012 06:23 Go to previous message
abz22
Messages: 1
Registered: August 2012
Junior Member
WHEN-FORM-NAVIGATE works with OPEN_FORM. Returning from form opened with CALL_FORM doesnt call this trigger.
But because CALL_FORM works synchronically, solution described earlier works! :


CALL_FORM .......
...........waiting until CALL_FORM ends

YOUR CODE.......

Previous Topic: disable function keys
Next Topic: displaying no. of records with condition
Goto Forum:
  


Current Time: Thu Apr 25 22:09:22 CDT 2024