Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox class properties don't make sense?
Message
From
19/04/1998 13:38:57
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
 
 
To
19/04/1998 10:08:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00093227
Message ID:
00093259
Views:
25
>Hi Raul,
>You said you were able to see correct ID it should be 5.0, in 3.0 it was a problem to show an integer value.
>First textbox part would be empty as normal, your boundcolumn=1 which is ID. Now I should understand something, don't you want to show the itemtext and have itemID (I think actually you want is it since you set columnwidths to 0,75)?

Yes, that's what I want.

> If so simply boundcolumn=2 (text), get ID with .list(.listindex,1). You didn't tell about controlsource. Maybe it's the one causing trouble (ie: a lookup table).

That's the issue. .ControlSource = M.ITEMID, later I do a GATH MEMV on the target table.
.list(.listindex, 1) would work but I would have to change a lot of code to put M.ITEMID = MyCombo.list(.listindex, 1) before the GATH MEMV. Also when the record is accessed for editing I would have to search the .LIST for the row that has M.ITEMID before showing the combo, again lots of changes and a short deadline.:)

> If so, I think your trouble is with displayvalue vs value. It's hard to explain what's going on by words. So a code might do it better, study with following class code and try with it, I hope everything will be more clear :
>
************************
>*-- Class:        mycombo_edit (c:\temp\test.vcx)
>*-- ParentClass:  combobox
>*-- BaseClass:    combobox
>*
>DEFINE CLASS mycombo_edit AS combobox
>
>
>Height = 22
>Width = 100
>DisabledBackColor = RGB(255,255,255)
>aliasname = "None"
>fieldname = "None"
>Name = "mycombo_edit"
>
>
>PROCEDURE When
>  THIS.REQUERY
>ENDPROC
>
>
>PROCEDURE LostFocus
>  this.value = this.displayvalue
>ENDPROC
>
>
>PROCEDURE Init
>  WITH This
>   .rowsourcetype = 3
>   if lower(.fieldname)="none" or ;
>    lower(.aliasname)="none"
>    .fieldname = substr(.controlsource,rat(".",.controlsource)+1)
>    .aliasname = substr(.controlsource,1,;
>        rat(".",.controlsource)-1)
>   endif
>   .rowsource = [SELECT DISTINCT ]+THIS.fieldname +;
>    [ as dummy FROM ]+this.aliasname+[ where !empty(]+THIS.fieldname + ;
>    [) union ] +;
>    [SELECT this.displayvalue as dummy ] +;
>    [ FROM ]+this.aliasname + ;
>    [ INTO cursor qq order by 1 ]
>  ENDWITH
>ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: mycombo_edit
>**************************************************
>Cetin

That's really clear, although I don't usually use an SQL for the RowSourceType I've seen a lot of people mentioning it's use. Performance gain?

The fastest fix I could find was to change the ID field to character type, and indexing on VAL(ID) now everything works ok w/o using BoundTo.

Thanks!

BTW
Is Medikosoft related to Medical Services software, Insurance Billing, etc...?
R. Davila
DBA / Network Administrator
Administracion de Fomento Comercial
Gobierno de Puerto Rico

Still waiting for FoxPro for LINUX
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform