FoxInCloud
ComboBox
Gravatar is a globally recognized avatar based on your email address. ComboBox
  Vincent H.
  All
  May 14, 2022 @ 12:02am

Hi Thierry,

Two thoughts about comboboxes:

  • The option is not disabled by a backslash if the popup is built with AddItem (if RowSource is a list, the backslash does disable the option)
  • Is the limitation to 255 characters of a list still justified in web mode ?
Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 17, 2022 @ 02:25am

Hi Vincent,

The option is not disabled by a backslash if the popup is built with .AddItem()

This is a VFP limitation: when using .AddItem(), VFP stores internally the disabled status of the item and displays it accordingly, and offers no way to query this status programmatically; FoxInCloud is thus unable to know that a given item is disabled.

I recommend you use .waRowSource as .rowSource instead:

dimension this.waRowSource[aLen(this.waRowSource)+1] && to be adapted when adding 1st element
this.waRowSource[aLen(this.waRowSource)] = '\disabled item'
…
this.rowSourceType = 5
this.rowSource = 'this.waRowSource'

limitation to 255 characters

Unsure what limitation you're referring to; please specify.

Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 17, 2022 @ 02:58am

Thanks Thierry, I will try with waRowSource ...

Limitation to 255 characters

The 255 character limitation concerns the value of the RowSource (RowSourceType = 1).
This list is cropped when it is longer

Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 17, 2022 @ 03:13am

Cool!

Here is a more generic code:

dimension this.waRowSource[iif(empty(this.waRowSource), 0, aLen(this.waRowSource))+1]
this.waRowSource[aLen(this.waRowSource)] = '\disabled item'
…
this.rowSourceType = 5
this.rowSource = 'this.waRowSource'
Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 17, 2022 @ 04:11am

It works perfectly, thank you !

Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  Vincent H.
  Vincent H.
  May 19, 2022 @ 11:27pm

I'm reconsidering the question of the length of the list in a combobox (RowSource = 1).

Is it possible to remove the existing limitation in the desktop version ?

Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 20, 2022 @ 12:59am

Len(.RowSource) <= 255 is another VFP limitation.

.waRowSource does not have such limitation; please consider this code :

o = CreateObject('awCbo') && as combobox, FoxInCloud class
o.RowSourceType = 1
o.RowSource = Replicate('a,', 150) && 300 chars
? Len(o.RowSource) && 256 
? o.listcount && 128

o.RowSourceType = 0

&& use .waRowSource instead
? ALines(o.waRowSource, Replicate('a,', 150), 5, ',') && 150
o.RowSourceType = 5
o.RowSource = 'o.waRowSource'
? o.listcount && 150

The best place to set .waRowSource and .RowSource is .Init()

Gravatar is a globally recognized avatar based on your email address. re: ComboBox
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 20, 2022 @ 01:10am

OK, thank you Thierry.

I must therefore systematically convert the list into an array if its length is greater than 255 characters.

© 1996-2022