Home » Developer & Programmer » Forms » WHEN-TIMER-EXPIRED refresh
WHEN-TIMER-EXPIRED refresh [message #155029] Wed, 11 January 2006 16:25 Go to next message
nellyauckland
Messages: 6
Registered: January 2006
Location: Auckland
Junior Member
Hi,
I have 2 forms open in an application, one is an alert screen which has a timer set at every 60 seconds, the other is a normal screen which the user can use to make modifications.

The alert screen is minimisied and the data entry screen is active with the user making changes in a text block, if the timer expires on the alert screen, the changes in the block where the user was making the changes are lost and the original text before modification is displayed (kind of like a clear no_commit has been done). The alert screen never becomes the active screen and is still running minimised.

Why does this happen? I have searched the entire code there are no clear/no_commit statements in any of the forms. I have commented out all code that should run when the when-time- expires trigger occurs and still the error occurs. It seems as is the timer-expires trigger does something in the backgorund.

Any help would be appreciated.
Thanks

code for when-timer-expired

DECLARE
expired_timer VARCHAR2(20);
BEGIN
expired_timer:=GET_APPLICATION_PROPERTY(TIMER_NAME);
IF expired_timer='SHOWBUTTONHELP__X' THEN
hint.ShowButtonHelpHandler;
ELSIF expired_timer='AUTO_ALERT_TIMER' THEN
-- auto_alert_timer_expired;
null;
END IF;
END;
Re: WHEN-TIMER-EXPIRED refresh [message #155030 is a reply to message #155029] Wed, 11 January 2006 16:33 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Do you have an execute_query in your 'normal screen'?

Follow my train of thought here, the timer fires, the 'alert screen' becomes the 'focus', the 'alert screen' does its work, 'focus' returns to your 'normal screen', the When-form-navigate trigger fires, plus the various pre-block triggers etc, I think one of these has an execute_query command in it.

Put a 'message('asdf');pause;' pair at the beginning and end of EVERY trigger in each of your forms and SEE the order in which your triggers are being fired. The cause is then, normally, blindingly obvious. The solution, well, that is another 'kettle of fish' altogether.

David

[Updated on: Wed, 11 January 2006 18:35]

Report message to a moderator

Re: WHEN-TIMER-EXPIRED refresh [message #155227 is a reply to message #155030] Thu, 12 January 2006 20:18 Go to previous messageGo to next message
nellyauckland
Messages: 6
Registered: January 2006
Location: Auckland
Junior Member
Hi,
not sure if you got my prev email but just to make sure:
I had already done what you mentioned only to find that
the only triggers that fire are as follows in seq:
1) Alert form: when-timer-expired which does what it has to (have commented out the call to the procedure so not doing much at all actually)
2) Data screen: when-new-item-instance trigger gets triggerred.
code in that is as follows
DECLARE
w_handle VARCHAR2(100);
BEGIN
w_handle := get_item_property('telex.message', WINDOW_HANDLE);
win_api_shell.sendkeys(w_handle, '^{Home}', FALSE);
END;

Even if I comment out all code in this trigger I get the same result.

I forgot to mention that the field being edited is multilined text length about 2000 char.
The only way I have managed to keep what is in the buffer is by moving to another field after my changes are finished, this seems to somehow save the buffer...(can we control how often this is saved? and can we save while we are in the field?)
Then when the alert triggers and comes back to the data screen changes are not cleared.

HELP! I have searched the net and people seemed to have similar trouble with timers, mainly to do with prompt not coming back to place where it was left...(least of my problems!) but no solutions. Any ideas?

Thanks
Re: WHEN-TIMER-EXPIRED refresh [message #155228 is a reply to message #155227] Thu, 12 January 2006 20:37 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You said in your original post
Quote:

if the timer expires on the alert screen, the changes in the block where the user was making the changes are lost and the original text before modification is displayed
If I was to paraphrase your quote as
Quote:

WHEN the timer expires on the alert screen, the ONLY THE changes in the CURRENT FIELD where the user was making the changes are lost and the original text before modification is displayed
would I be correct?

If this is so, then there may be little we can do. But first, tell me what "win_api_shell.sendkeys(w_handle, '^{Home}', FALSE);" does. I know I can look it up but I am a bit pressed for time at the moment.

By the way, what does this alert do? Yanking the user out of their application while they are trying to do some work is not nice.

Alternative resolution approach:
(1) Use two browser sessions. That is, run the Alert program in its own browser so that it doesn't affect your working form.
(2) Put a post-text-item trigger on your block and see if it fires when you application jumps to the other form.

David
Re: WHEN-TIMER-EXPIRED refresh [message #155232 is a reply to message #155228] Thu, 12 January 2006 20:48 Go to previous messageGo to next message
nellyauckland
Messages: 6
Registered: January 2006
Location: Auckland
Junior Member
you are correct in saying that only changes being made in the current field being edited (only the mutli-lined one actually) gets lost.
The command yo speak of puts the cursor in the correct position. At the beginning of the text in my case.

: ) the users are currently doing what you say by running 2 sessions and not liking it...I have been told to fix it : (

I have done post-text but only gets fired when I leave the field..

The alert form actually checks every minute if there is any new alerts ...if there is one it pops up a message otherwise does nothing, so runs in the background all the time

Thanks
Re: WHEN-TIMER-EXPIRED refresh [message #155236 is a reply to message #155232] Thu, 12 January 2006 21:48 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I expected that I would get the answer that you have given. From what you have said, that the Post-Text trigger does not fire, the reason you are 'losing' the changes is that, as far as the Form is concerned, they haven't happened. If they were 'perceived' the Post-Text trigger would fire before you went to the Alert.

What happens if you remove the when-new-item-instance trigger?

David
Re: WHEN-TIMER-EXPIRED refresh [message #155379 is a reply to message #155236] Sun, 15 January 2006 13:27 Go to previous messageGo to next message
nellyauckland
Messages: 6
Registered: January 2006
Location: Auckland
Junior Member
Hmmm..looks like I am in trouble...
had tried what you asked but just fires another trigger on the block level when-form-activated which also doesnt do much.
I also tried forcing it to change to another field when this triger fired hoping it would force a save on what was in the buffer but no good...

Thanks
Nalini
Re: WHEN-TIMER-EXPIRED refresh [message #155385 is a reply to message #155379] Sun, 15 January 2006 16:52 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I suppose When-Window-Deactivated does not fire because the 'other' window is in another form, not the same form. Test this please. But hey, if you put the alert in THIS form then you may get a When-Window-Deactivated trigger to fire in the 'user' window and then you could do a Next_Item follwoed by a Previous_Item before going to the Alert window. This 'item shuffle' will cause any validation to fire and for the form to recognise any changed text, but put you back in the field from which you came (assuming you had no special navigation defined on either field). If you tell the form to 'remember the location', when you come back from the alert do another 'item shuffle' otherwise when you 'go to' the item in which the user was working ALL the text will have been selected and when they 'press a character' all the previous text will be 'eaten'.

David
Previous Topic: Use OLE2 packege in Forms&Reports 6.0.
Next Topic: run-time text color change (merged)
Goto Forum:
  


Current Time: Fri Sep 20 05:34:24 CDT 2024