Select to view content in your preferred language

python add-in combobox - no visible value if editable = False?

1327
1
08-05-2014 07:52 AM
theMC5
by
Deactivated User

If I have a combobox that is set .editable = False to force the user to pick from its list, when the user does so, the selected value is not displayed in the combobox's text area - it stays blank with no indication of what was selected. I've even gone so far in the onSelChange() to set .value and call .refresh(), no difference. Am I missing something?  Thanks, MC

Tags (2)
0 Kudos
1 Reply
ToddUlery
Regular Contributor

Hi MC5,

I think it is best to keep the

self.editable = true

I have placed the part where my items list is populated within the onFocus function.

def onFocus:(self, focused):
     self.items = []
**** THE PART THE POPULATES THE LIST ****


     self.items.append(**VALUE**)

The onSelChange fuction:

def onSelChange(self, selection)
     self.refresh()
     X = selection

This function is used to do something with the selection that is made, setting the selection parameter to a variable.

I believe the reason why you are not getting anything in the box is because of the editable attribute being false.

You may be better served to look into putting an item in the List just as a starter. "Please Pick From the Dropdown."

Then when the onFocus is triggered it would empty the list items, and populate with new items that you want.

0 Kudos