Re: mouse navigation and item validation issue in forms 5.0

From: Alexander Medvedev <a.medvedev_at_globalone.ru>
Date: Thu, 07 Dec 2000 15:15:06 +0300
Message-ID: <3A2F7F4A.98AF6DB1_at_globalone.ru>


G&K F wrote:

> I've worked on this for a while now I am just not able to figure it out.
>
> I've got 2 non-database blocks. The top block is a query block that
> contains fields like item and location,
> the bottom block lets you enter case numbers that would be in the
> location from block 1 and the item of block 1 and the function of the
> form is to delete these cases using a push buttom.
> So of course I have validation on the case number field that checks if
> this is a valid case (one of the validation reasons is to make sure it
> is our case and not a consignment case). Well, the problem is, when
> the validation errors out, I want to let the use go back to the first
> block. This works fine with the key-prvblk trigger, but when I
> navigate with the mouse to the top block, it checks the when validation
> trigger again, so how do I not have this trigger go off when I go to
> the previous block with my mouse.
>
> I have tried to put the validation in the key next item trigger, which
> solves that problem, but then lets me click in the next row of the
> block without validating the case no again. So any thoughts on how to
> solve this problem without making the user exit the form and re-
> entering it.
>
> I am sure there must be an easy way to do this, but I am starting to
> see double on this thing.
>
> Thanks,
> Glenn
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Hi, Glenn! if I am quite clear with your need, you can work around this by using all validation you need located in ON-VALIDATE-ITEM triggers having a flag packaged variable analisys to interact whith other program code. For example:

Create package tmp as
 flag_validate boolean:=true;
end;

Trigger ON-VALIDATE-ITEM
begin
 if tmp.flag_validate then
.... all checks ....
 end if;
end;

Some program unit (trigger for example) which can be invoked when errors occured and you need let your user to navigate another block

.... tmp.flag_validate:=false; ...

At least this may be a second block on-validate-item trigger.

You have to take care of resuming validation by some appropriate event. For example:

Trigger KEY-COMMIT
 begin
  tmp.flag_validation:=true;
  commit;
 end;

[Quoted] Regards Alexander Medvedev Received on Thu Dec 07 2000 - 13:15:06 CET

Original text of this message