Getting Index of Selected Combobox in ArcGIS Python addin

812
0
05-25-2017 04:14 PM
BehrouzHosseini
Occasional Contributor

Using ArcGIS Python addin I need to get the Index of selected item from Combobox on change. I already tried

def onSelChange(self, text):  
        global selectedIndex
        selectedIndex = selection.current() 

in following code

class ComboBoxClass4(object):  
    """Implementation for MTR_addin.combobox (ComboBox)"""  
    def __init__(self):  
        self.value = "S"    
        self.items = ("A", "B", "C", "D", "E")   
        self.editable = True  
        self.enabled = True  
        self.dropdownWidth = 'WWW'  
        self.width = 'WWW'  
    def onSelChange(self, selection):  
        global selectedIndex
        selectedIndex = selection.current()    
    def onEditChange(self, text):  
        pass
    def onFocus(self, focused):  
        pass  
    def onEnter(self):  
        pass  
    def refresh(self):  
        pass 

but it is not working and I am getting this error

selection.current() AttributeError: 'str' object has no attribute 'current'

0 Kudos
0 Replies