DCSAY ... GET ... VALID ... POPUP ... question
Posted: Fri Apr 08, 2022 7:34 am
Hi,
With the code below I supposed the VALID would be executed ONCE if you do the following:
1. Click on the popup button
2. Click on the second GET or press ENTER in the first GET.
I didn't expect that the VALID is executed at the moment the POPUP returns to the GET? With the popup you don't LEAVE the GET, unless you returned an array where the second element is another object that must get the focus.
So when a popup is used, the VALID clause is always executed twice. When this valid is time-consuming, it can make a difference for the speed of an application.
Looks to me as this is not the behaviour you would expect?
With the code below I supposed the VALID would be executed ONCE if you do the following:
1. Click on the popup button
2. Click on the second GET or press ENTER in the first GET.
I didn't expect that the VALID is executed at the moment the POPUP returns to the GET? With the popup you don't LEAVE the GET, unless you returned an array where the second element is another object that must get the focus.
Code: Select all
function validpopuptest()
**************************
Local getlist := {} , cTest := space(10) , cTest2 := space(10) , lOk
@ 1,1 DCSAY "Test Valid: " GET cTest ;
VALID {|oGet,o| (DCBDEBUG 'validated'),.T. } ;
POPUP {|o,oGet| (DCBDEBUG 'popup'),(cTest:="ABC123")} ;
SAYRIGHT SAYSIZE 20 GETSIZE 20
@ 3,1 DCSAY "Second line: " GET cTest2 ;
SAYRIGHT SAYSIZE 20 GETSIZE 20
dcread gui fit addbuttons to lOk
return nil
Looks to me as this is not the behaviour you would expect?