Web 2.0 WebComboBox

I’m looking for some help with the Web 2.0 WebComboBox. I’ve loaded the choices into the drop down but I’m running into an issue is when I select something in my ListBox I’d like the value to match the selection. This is straight-forward enough with text boxes and with PopUps, but I can’t get it to work with a ComboBox.

I was hoping it would be as simple as:

self.InventoryFamilyComboBox.value = InventoryRS.Column("Family")

or

InventoryRS.Column("Family").StringValue=self.InventoryFamilyComboBox.SelectedRowValue

But apparently WebComboBoxes don’t have a SelectedRowValue method (although it looks like maybe they used to?)

Any tips for getting this to work?

Okay, no takers…

Is it because I didn’t describe it well enough, because it’s so obvious that I should have figured it out already, or because it doesn’t work properly yet in 2.0 and I need to wait for an update?

It’s likely because Web 2.0 is very new and it’s hard to answer questions without firing up a test project.

The docs indicate WebCombobox has a SelectedRowIndex property for selecting the row, and a Value property for the text value. What happens with setting the Value as you have above? The docs imply this should work.

It doesn’t work yet in the current official release.

It runs, but doesn’t actually do anything. I guess the good news is it doesn’t crash, right? :rofl:

I’m assuming it will be fixed, then. I have plenty to do before this becomes something I really need to worry about. I can wait.

Thank you for the info!

1 Like

Unlike the Desktop ComboBox, you cannot set the Value of a WebComboBox to anything other than one of the Values in the popup list.

If you do, the Value of the WebComboBox is the previously chosen Value. I am not sure if this is a bug or is intentional.

1 Like

Okay, but I can’t seem to even get it to do that. I have values that are loaded in from a database, but using this:

self.CategoryComboBox.SelectedRowWithValue(MusicLibraryRS.Column("Category").Value)

It tells me “Type WebComboBox has no member named 'SelectedRowWithValue,” which kind of leaves me at a loss as to how to select the correct row.

Surely it is just:

CategoryComboBox.Value = MusicLibraryRS.Column("Category").Value

That’s what I thought, too, but the value never changes regardless of the selection.

¯_(ツ)_/¯

Maybe I have something else wrong in a method somewhere that’s screwing it up, but I can’t find it.

There’s a feedback ticket you can track here <https://xojo.com/issue/61932>

Thank you, Tim. And I did read Jeannot’s reply, but apparently my brain dumped that answer.

And thank you everyone. I’ll just be patient.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.