Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MultiColumn dropdown list remains blank -- part II
Message
From
07/03/2002 12:56:34
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00629232
Message ID:
00629730
Views:
24
>Is there any code in the combo's base class refresh()?

No just the code shown here.

>
>>I am (still) having a serious problem with a ComboBox.
>>
>>There is an interaction with my standard data input form I do not understand.
>>
>>When the comboBox below is put into my form it always is blank.
>>
>>
>>DEFINE CLASS cbovendors AS combobox
>>
>>	Tag = "this is the test cboVendor - based on base combobox - delete me"
>>	BoundColumn = 2
>>	ColumnCount = 1
>>	ControlSource = "vendors_id"
>>	Height = 24
>>	Style = 2
>>	Width = 159
>>	BoundTo = .T.
>>	Name = "cboVendors"
>>
>>	PROCEDURE Init
>>		select vn_name,vendors_id from vendors into array aVendors order by 1
>>		nNoRows = alen(aVendors,1)
>>		for nRow = 1 to nNoRows
>>			= this.AddListItem(aVendors[nRow,1],nRow,1)
>>			= this.AddListItem(aVendors[nRow,2],nRow,2)
>>		endfor
>>		= dodefault()
>>	ENDPROC
>>
>>ENDDEFINE
>>
>>
>>When I create a form using the Form Wizard and insert the control it works as it should.
>>
>>When I insert breaks (set step on) into my standard data input form methods it also works as it should!!! Only by removing the breaks and logging to a text file could I see what was happening it real time.
>>
>>When you step through the table cboVendors.Value shows the correct value - equip.vendors_id. cboVendors.DisplayValue is blank. cboVendors.ListIndex is 0.
>>
>>To make the control work as it should in my form I added the following to the class definition :
>>
>>
>>	PROCEDURE Refresh
>>	= dodefault()
>>	if empty(.DisplayValue) and not empty(.Value)
>>		for nRow = 1 to .ListCount
>>			if .Value = .List[nRow,2]
>>				.ListIndex = nRow
>>				exit
>>			endif
>>		endfor
>>	endif
>>
>>
>>With this addition it works. But of course the control should do this work internally. And it does when it is not included in my standard form.
>>
>>Can anyone suggust a reason for this? It is as if control freezes and does not Refresh.
Best Regards
Don Simpson
Previous
Reply
Map
View

Click here to load this message in the networking platform