Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox valid/lostfocus fires before interactivechange?
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Combobox valid/lostfocus fires before interactivechange?
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 10
Miscellaneous
Thread ID:
01665845
Message ID:
01665845
Views:
141
Maybe this has never mattered before, but I haven't noticed it until now:

I had code in the lostfocus method to add what a user typed into the dropdown list dynamically using additem(). This worked great until I added some code into the valid for this class. As I've been debugging, I noticed that typed information now gets wiped out when leaving the field. I tried adding some debugging code into the interactivechange to see if I could use additem there. When I step through the code, it appears that the interactivechange method begins to fire, but the valid takes over, then the lostfocus, then finally gets back to the interactivechange. Worse, after the valid finishes, the displayvalue for the control is blanked and consequently, so becomes the value, thus blanking the control, so there is nothing there for additem().

However, as far as I can see, when I set coverage logging on, it appears to log what I expect (simply runs interactive change until moving out of the control, but the control still blanks out. What would cause the control to lose focus during an interactive change?

I had a keypress event in the form, which I suspected was causing trouble. I've taken that out and still have the same behavior.

if I have no code in the valid, then the lostfocus has a this.displayvalue and the text is added to the list and still displays in the control. Adding anything to the valid breaks this behavior. What in the world am I missing? Any advice would be greatly appreciated!
Steve Howie, owner
DaSH Technology
Denver, CO
Next
Reply
Map
View

Click here to load this message in the networking platform