mierlp Posted September 20, 2014 Share Posted September 20, 2014 After the user appends a record i do a OnBeforePost check to see if all fields are filled. I use this code (like in all my Delphi projects) : if length(dmPortal.Gast.FieldbyName('LastName').asString) =0 then begin sSenderComponent:='uniDBEdit_LastName'; MessageDlg('You have to fill the LASTNAME, mtInformation, [mbOK], MessageComponentFocus'; Abort; end; Then the MEssageComponentFocus: Procedure TdmPortal.MessageComponentFocus(Sender: TComponnt; Res: Integer); begin if sSenderComponent='uniDBEdit_LastName' then begin FormRegistrationGuest.uniDBEdit_LastName.SetFocus end; end; For some reason the append will be canceld...which my not be done by the ABORT. This code works in Delphi application and should also workin uniGui. Sugguestions/tips please...i use latest version/build (0.97.1077) Regards Peter Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 20, 2014 Administrators Share Posted September 20, 2014 I can not reproduce. In my test Append mode remains active until as long as Abort is called. Quote Link to comment Share on other sites More sharing options...
AlbertoVesx Posted September 20, 2014 Share Posted September 20, 2014 Maybe your datasource is linked to a unidbgrid and the cursor move. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 20, 2014 Administrators Share Posted September 20, 2014 I tested with a dbgrid. Quote Link to comment Share on other sites More sharing options...
mierlp Posted September 21, 2014 Author Share Posted September 21, 2014 Hi The database which is connected to the DB fields is also connected to the dbgrid and should not be problem (compared to a Win32 application) How looks you code Farshad...because the abort may not canceld the append...it just has to 'abort' the action...this is normal behavior ? I use the same principle as with win32 apps...and i know not all may compaire...but i don't give a : dmPortal.Gast.CANCEL command so...till then the append must be 'alive' The abort is also cancelling the append what you normally do with dmPortal.gast.CANCEL (like the above sample) Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted September 21, 2014 Administrators Share Posted September 21, 2014 You need to send a test case please. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.