Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2441
  • Last Modified:

Oracle Forms - Loosing focus when a Timer expires

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
Peter_at_fjs
Asked:
Peter_at_fjs
  • 3
  • 3
3 Solutions
 
Helena Markováprogrammer-analystCommented:
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
 
Mark GeerlingsDatabase AdministratorCommented:
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
 
Peter_at_fjsAuthor Commented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Mark GeerlingsDatabase AdministratorCommented:
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
 
Peter_at_fjsAuthor Commented:
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
 
Mark GeerlingsDatabase AdministratorCommented:
Which mechanism do you use to open the called forms: CALL_FORM or OPEN_FORM?
0
 
Peter_at_fjsAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now