Recent

Author Topic: DBEdit with validation in event onSetText - bug ?  (Read 2410 times)

betovgbt

  • Newbie
  • Posts: 1
DBEdit with validation in event onSetText - bug ?
« on: April 08, 2016, 11:33:56 pm »
I decided to move from Delphi to Lazarus and I found a problem as follows

1)  create tbufdatase with 2 fields
     and put in form, along with dbnavigator  DBEdit to first field and the second field put in a grid, and
     create event on settext to first field a validation example as below
   .....
     if atext='1' then begin
        showmessage('invalid!');
        abort;
      end;
     Sender.value:=atext;
    ....

    immediately after entering the value 1 in dbedit, trigger update on DBNavigator and Lazarus will display
    two simultaneous messages incorrectly! (Make sure that in this situation the state bufdataset =
      dsinsert)

I create one topic in bugtracker (id 0029931), but  recommendation which prematurely ended  and wrong, he took the case-validation in MaskEdit recommending the action below

in maskedit.pp ( include lcl_define.inc changed  this file
with {$DEFINE MASKEDIT_NOVALIDATEONEXIT} )

I compiled and the problem remained

2) in Delphi this works properly displaying one correct message!
 
I use delphi since the first version and if anyone recommend that the OnSetText event is not good to put validation, I will totally disagree, because I use extensively without problems.

(in the bug tracker topic i put the solution to application, but did not know if it was a bug or not with the source)

what do you consider? (I already know that Lazarus does not follow the delphi 100%)

thanks

 

TinyPortal © 2005-2018