Oracle Forms - Loosing focus when a Timer expires

Posted on 2010-11-15
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
Question by:Peter_at_fjs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
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.
LVL 35

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.

Author Comment

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.

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

LVL 35

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.

Accepted Solution

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.
LVL 35

Expert Comment

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

Author Closing Comment

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.

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses

628 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