Wicket Posted November 15, 2017 Share Posted November 15, 2017 Hi All, What is the best way to validate fields on a modal form? I need to check that the field is not empty before closing the form - usually I would do this on the button OK click, setting the modalresult = mrnone, then check the fields are <> '', then call modalresult = mrOK. I cant use this technique in unigui due to the multi-threaded nature. So, my question is how can i not close the form if I have a certain required field that is empty? Any elegant way to achieve this? Thanks, Dan Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted November 15, 2017 Administrators Share Posted November 15, 2017 Hi, It is quite simple. In OnClose event check your fields and set CloseAction to caNone if form should not be closed. Thanks Link to comment Share on other sites More sharing options...
Wicket Posted November 15, 2017 Author Share Posted November 15, 2017 Thanks Farshad - I'm always over complicating things! Link to comment Share on other sites More sharing options...
vbdavie Posted June 25, 2021 Share Posted June 25, 2021 THis doesn't work for me. I set the Action:=caNone; And the form STILL CLOSES. Do you have an example demo to show how to do it properly? BTW: I am using formname.ShowModal; to display the form. Thanks DAvie Link to comment Share on other sites More sharing options...
alfr Posted June 25, 2021 Share Posted June 25, 2021 Mainmodule.enableSyncronisation:= true see more on link http://www.unigui.com/doc/online_help/synch-and-asynch-operations.htm Link to comment Share on other sites More sharing options...
vbdavie Posted June 29, 2021 Share Posted June 29, 2021 i already fo that since many years. davie Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now