Solved

Oracle Forms - Loosing focus when a Timer expires

Posted on 2010-11-15
7
2,261 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
[X]
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
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 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.
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup

735 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