Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug in combobox?
Message
From
07/11/2005 11:23:45
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065415
Message ID:
01066017
Views:
23
>>>Hi everybody,
>>>
>>>So far I didn't receive any satisfactory answer on my problem that is really driving us crazy. I am thinking we may hit a bug in VFP. Unfortunately I don't have enough time to try to prepare a test case, but here is the simplified scenario.
>>>
>>>We have a combobox, that is bound to a table buffered view field. The combobox RowSource is an array, that is set in run-time in combo's Init
>>>this.RowSource = "this.arrData"
>>>this.RowSourceType = 5.
>>>
>>>If I interactively or programmatically change the value in the combobox and then tablerevert my changes by pressing Cancel button, the GetNextModified function still returns the record number and GetFldState returns combo's bound field as changed. I don't understand this behavior and consider it as a bug unless you can find what is wrong in the scenario I describe.
>>>
>>>The related thread is Re: Combobox again Thread #1064970 Message #1065299
>>>
>>>Please help me with a workaround or let me know if it is really a bug and it's going to be fixed.
>>>
>>>Thanks a lot in advance.
>>
>>
>>Nadya,
>>
>>It's the same problem, but disguised
>>
>>After the TableRevert(), do a thisform.Refresh() to get rid of the change in the combo.
>>
>>If you do not refresh(), the combo's lostfocus will update its controlsource. That will then be reflected in GetNextModified()
>
>I think we do have thisform.refresh in the Cancel method of the form. For some reason it's not enough. I may try to play with form's postcancel hook and play with that combo specifically since it's giving me problems.

You only need a combo.Refresh() if it has the focus. (and if it is visible at that moment, it would be nice for the user to see the old value, ie action cancelled)

If the combo has the focus and is on a non-active page of a pageframe, I do not think it will be refreshed with thisform.refresh() [ see some other thread: container.Refresh() ]

So, the best thing to do is to make sure that the combo does not have the focus, tablerevert(), then refresh()
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform