Re: Forms 4.5 Menu Processing...

From: QuadTwin <quadtwin_at_aol.com>
Date: 1997/09/27
Message-ID: <19970927134501.JAA12590_at_ladder01.news.aol.com>#1/1


[Quoted] vijayd_at_nortel.com wrote:

> Hi,
>
> Background: ===========
> I have a form with a Text Item that has a WHEN-VALIDATE-TRIGGER.
> This trigger raises FORM_TRIGGER_FAILURE whenever the trigger fails.
> The form as an associated menu with the menu commands also provided
> using buttons within a toolbar.
>
> Both the Menuitem and the corresponding toolbar button calls a user
> defined trigger. Therefore, the code executed by both are exactly the
> same. The trigger then calls a "DoSave" procedure.
>
> Problem: ======== When I type something in the Text field and
> "without hitting enter or tab", I select Save Menuitem, the
> WHEN-VALIDATE-TRIGGER is not executed. To avoid this problem, I put a
> go_item('some other item') in the DoSave procedure before actually
> saving the data. In this case, the WHEN-VAL... is executed, but if
> the trigger fails, the FORM-TRIGGER FAILURE does not get raised and
> the DoSave procedure continues processing.
>
> But, when I click on the Save toolbar button, the
> WHEN-VALIDATE-TRIGGER always gets executed correctly and I have no
> problems.
>
> Can anyone tell me why this happens and how to make it work exactly
> as it should.

[Quoted] I think I can. First, what you need to do in this common trigger is execute the builtin ENTER; as the first statement. This takes the place of the user hitting the ENTER key. The reason for the difference is that the WHEN-VALIDATE-ITEM trigger only fires when the "leave-the-item" event occurs. This occurs when you click on another field or use the keyboard enter or tab keys. When you use the mouse to select a menu item, the focus is still in the item whose value was entered. When you click on a button, the focus may optionally leave the button. The determination of whether the toolbar button gains focus or not is a property of the button. Typically you do not want to change focus to a toolbar button when it is pressed. I suggest you change the MOUSE_NAVIGABLE property of the buttons to FALSE. Then the toolbar button and the menu should operate the same way. But you will have to have the ENTER statement in EVERY TRIGGER associated with your toolbar buttons and menu selections.

Hope this proves to be helpful and accurate,

Al Lawson
Interactive Group, Inc.
www.interactive-group.com
lawsona_at_interactive-group.com Received on Sat Sep 27 1997 - 00:00:00 CEST

Original text of this message