Solved

Oracle Forms - Loosing focus when a Timer expires

Posted on 2010-11-15
7
2,182 Views
Last Modified: 2012-05-10
We are implementing a Timer in our Oracle Forms application to implement an Emergency Broadcast solution. The Timer is set on our 'welcome' form, when the timer expires the form checks whether an emergency message has been added to the database and displays it.

This works, however we have noticed some undesirable effects on other screens when the timer expires - focus is momentarily switches back to the 'welcome' screen and interrupts user activity. In some cases the cursor goes back to column 1 of a field, other times a canvas is incorrectly displayed and also an opened menu is removed from display.

We can work-around most of these side-effects, although a solution to the removal of an open menu is eluding us. But we are worried about other un-noticed side-effects.

Is there any way we can configure the timer without it switching focus back to its form when it expires? Or is there another way we can regularly check whether data has been added to the database?

Many thanks
0
Comment
Question by:Peter_at_fjs
  • 3
  • 3
7 Comments
 
LVL 22

Assisted Solution

by:Helena Marková
Helena Marková earned 100 total points
ID: 34144142
I would put When-Timer-Expired trigger to every form. Then you can easily do what you want on particular form when trigger expires.
0
 
LVL 34

Expert Comment

by:Mark Geerlings
ID: 34144921
I agree with Henka.  I would not depend on a When-Timer-Expired trigger to do only and exactly what you want, if that is in a form that is not the currently-active form.

If you want some logic to be available from any/all of your forms, I would put that logic in a procedure (or function) in a *.PLL file that you attach to all of your forms.  It will be difficult though in Oracle Forms to automatically have every form query the database at particular intervals, regardless of what the operator is doing in the form at the time.  You could easily add a call to this (*.PLL-based) procedure in each When-New-Form-Instance trigger and write a Key-Exit trigger in each form that does the same.  If you want this check to happen automatically in between those events, you could use a When-Timer-Expired trigger in each form.  If your application allows the users to have multiple forms open, but only one active, you may need to add logic to your procedure to first determine whether the form is currently active or not.
0
 

Author Comment

by:Peter_at_fjs
ID: 34146590
We've performed a trial on your comment, it doesn't work, so I may have misunderstood.

1) Started a Timer from our 'Welcome' form

2) When-Timer-Expired triggers was put onto 3 forms, but when the timer elapsed the only trigger that fired was the one on the original 'welcome' form, rather than the active ones.

Focus then switches back to the 'welcome' form for an instance causing us the problems.

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 34

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 400 total points
ID: 34146795
Note this "Usage Note" from the Oracle Forms documentation for When-Timer-Expired triggers:

"The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing."

(Yes, that line does look like it was written by a non-native speaker of English.  It seems to either be missing a word or two, or to have an unexpected comma or two.)

There are some limitations on when a When-Timer-Expired trigger can fire (basically when the user is inactive in the form).

I think it is possible in a trigger to investigate the call stack to determine if the form currently is active or not.  That may vary depending on whether you use the OPEN_FORM or CALL_FORM command to launch additional forms.

If not, it would be easy to add a non-displayed, non-base table field (maybe in a non-base-table "control" block) in your original 'welcome' form that you set to a non-null value when another form is launched.  The When-Timer-Expired trigger in that 'welcome' form can check the value of this field, and do nothing if it is non-null.  The trigger that does the CALL_FORM or OPEN_FORM should clear this value after the user returns to the 'welcome" form.  That way, you may be able to use a When-Timer-Expired trigger in each of the other forms to do the action you want there.
0
 

Accepted Solution

by:
Peter_at_fjs earned 0 total points
ID: 34186137
We have decided to 'work around' the problem. We have made changes to properties of two of our subclassed items. This has fixed the majority of the knock-on effects of the timer expiring.

We think the reason why the suggested solutions didn't work is that the timer is a session timer and we open all new forms with new database sessions.

The only remaining issue is that if the user opens a menu on another form when the timer expires the menu disappears. We don't think that we can fix this and as the timer is 5 minutes long we are hoping that it will not be too much of a problem. We did program a mechanism so that the timer can be switched off if it proves too problematic.

If you can offer advice on the menu disappearing I would appreciate it.
0
 
LVL 34

Expert Comment

by:Mark Geerlings
ID: 34192479
Which mechanism do you use to open the called forms: CALL_FORM or OPEN_FORM?
0
 

Author Closing Comment

by:Peter_at_fjs
ID: 34328773
Whilst we work-around our issues with timers, I am happy to allocate the points to those who tried to help. I have awarded 100 points to Henka for being the first respond and the 400 points to markgeer for spending the most effort.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Via a live example, show how to take different types of Oracle backups using RMAN.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now