hi jdnt,
what u want to do is not logical actually.but even then, if the when-timr-expired fires in form 'a' and u go_form to form 'b' then the when-window-activated trigger in form 'b' fires and some staff is done but the problem is, after this is happened ,in the form 'a' the when-timer-expired trigger fires but in the form 'b' the when-window-activated trigger does not fire, is not it?
actually when the focus is in form 'b' then again a when-window-activated will not fire,so what u have to do is ,u have to use the go_form builtin to move the focus again in
form 'a',in the code of when-window-activated
trigger ,after the code for the stuff u want to be done .
once ur when-window-activated trigger is fired for one form 'b' then in no way it will fire again if the focus is still in that form.so u have to have the focus moved to another form 'a' and again move to form 'b' then ur when'-window-activated will fire.follow the way:
1.suppose u created the timer in when-new-form-instance trigger of form 'a'-
declare
tt timer;
begin
create_timer('t1',6000,rep
end;
note:u may use a button to initiate the timer as well.
2.in the when-timer-expired trigger of form 'a' place the code -
if not id_null(find_form('b'))the
delete_timer('t1');
go_form('b');
end if;
note: here u just going to form 'b' that means form 'b'
is already opend by any means.
3.in the when-window-activated trigger in form 'b' place the code -
ur stuff;
if not id_null(find_form('a'))the
go_form('a');
end if;
4.u have to create one new trigger in form 'a' that is
when-form-navigate,the code will be -
declare
tt timer;
begin
if id_null(find_timer('t1')) then
tt := create_timer('t1',2000,rep
end if;
end ;
in this way u delete the timer in the expiration of the timer and again while coming to form 'a' u r creating the timer.this is because if u continue with the
timer which is created at first moment ,when u come back to form 'a' from form 'b' ,the when-timer-expired trigge does not work properly (i tested this method);
so when the focus is sent to form 'a' through the when-window-activated trigger of form 'b' ,the when-form-navigate trigger of form 'a'again create the timer ,so the when-timer-expired trigger in form 'a' will fire in due time.again the when-timer-expired trigger will send the focus to form 'b' and the when-window-activated triger of form 'b' will fire.
here a point to be noted that wh-win-active is a trigger that fires at the very first moment when focus is sent a form.so if u go to the earlier form using go_form builtin from this trigger ,u dont have any chance to do any work in the form where wh-win-active fires.
thats why at the very first line of this comment i told 'what u want to do is not logical'.
thanks
mehbub
Main Topics
Browse All Topics





by: HenkaPosted on 2003-03-25 at 04:24:06ID: 8202182
It is an interesting question. Maybe the solution is putting code from When-Window-Activated trigger to the When-New-Form-Instance ?