Re: Processing of WHEN-NEW-ITEM-INSTANCE FORMS4.5

From: Blair Layton <cs321717_at_student.uq.edu.au>
Date: 1995/11/29
Message-ID: <49g82q$q4o_at_bunyip.cc.uq.oz.au>#1/1


100704.1155_at_compuserve.com (Kevin Croocmbe) writes:

>FORMS 4.5.6.0.7
 
>I am struggling to understand the precise circumstances under
>which the WHEN-NEW-ITEM-INSTANCE trigger fires.
 

>My interpretation of the reference manual and the processing
>flow-charts indicate that it should fire when BOTH the the
>following conditions are true:-
 

>a) The trigger process is 'Returning for Input' AND
 

>b) the value of cursor item differs from the value it
> held on the last occasion that the 'Return for Input'
> process executed.

>However, I find this interpretation at odds with the observed
>behavior. I would expect the following trigger to fire just once
>whenever the user navigates ordinarily to block1.item1.

>WHEN-NEW-ITEM-INSTANCE (attached to block1.item1)

>begin
 

> go_item('block2.item1');
 

> go_item('block1.item1');
 

>end;

>However, I find that what actually happens is that the
>form fires the WHEN-NEW-INSTANCE-TRIGGER ad infinitum
> - presumably because the go_item('block1.item1) is
>(unexpectedly) causing the trigger to re-fire!

What follows is what happens in Forms 4.5, not necessarily what should happen :-). I don't know what should happen!

With the above code you have changed the :SYSTEM.CURSOR_ITEM to 'block2.item1' and then back to 'block1.item1', which flags the WNII trigger to fire again, hence creating the infinite loop.

If you had only placed a Go_Item('block1.item1') (stupid, I know) it would not fire the WNII again, since the SYSTEM.CURSOR_ITEM would not have changed in the course of executing the current block of code.

A Go_Item('block2.item1') would result in the WNII of 'block2.item1' firing (assuming one exists).

The WNII trigger is fired whenever control returns to the user and, during the processing of the event that caused the user to lose control, the :SYSTEM.CURSOR_ITEM was changed. With the exception (bug time) that if the code is called from a menu then the WNII may fire with code already on the stack. This causes MAJOR problems.

>The same code as a WHEN-NEW-BLOCK-INSTANCE trigger,
>fires only once (as I would expect).

Looks like something is wrong :-(.

>Questions []


Blair Layton, Research Assistant              Wk: 61-7-3365-1181
Center for Software Maintenance               Hm: 61-7-3217-8713
University of Queensland              The future will Be! ->   
Brisbane, Queensland, Australia              http://www.be.com
----------------------------------------------------------------
Received on Wed Nov 29 1995 - 00:00:00 CET

Original text of this message