Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox valid/lostfocus fires before interactivechange?
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 10
Miscellaneous
Thread ID:
01665845
Message ID:
01665872
Views:
108
>I just tried with a base class combobox on a new form and got the same behavior: if I put code both in valid and lostfocus, there will be no displayvalue in the lostfocus method. if valid is empty, then lostfocus has a display value. This seems so basic - if I put this.additem() into the valid, nothing happens. my rowsourcetype is 1 (value). What's the easiest way around this limitation?
>
>To recreate my test:
>drop a combobox on a new form. Set controlsource to some table, field1 (character c(10) or whatever)
>set the rowsourcetype to 1
>put "A,B,C,D" in rowsource
>
>put in lostfocus:
>
this.additem(this.displayvalue)
>
>If you just do this and run the form, typing "123" or whatever in the box and hitting tab will keep the 123 and add it to the dropdown combo.
>
>if you put anything in the valid, such as x=1, and rerun, then the box will blank out when you hit tab. the control's displayvalue will blank as soon as it exits the valid. Also, issuing this.additem(this.displayvalue) in the valid doesn't seem to add the line to the rowsource, even though the displayvalue does still show in the valid.
>
>Is this expected behavior? a bug? I feel truly dense right now that this doesn't work...

update - for now, I moved the offending valid code to another subclass tree where it is needed (not really needed here yet), so this form works again. However, if my other form needs editable comboboxes, and code in the valid, I will hit this again. Anyone have thoughts on the above problem?
Steve Howie, owner
DaSH Technology
Denver, CO
Previous
Reply
Map
View

Click here to load this message in the networking platform