I have two combo boxes. I am trying to add items dynamically into the second combobox from the first combobox's "onSelChange(self, selection)"onSelChange(self, selection)
event.
due to some reason, this is not working.
hereHere is my sample code:
import arcpy import pythonaddins
class ComboBoxClass1(object): """Implementation for TestCombo_addin.combobox (ComboBox)""" def init(self): self.items = ["cb1item1", "cb1item2"] self.editable = True self.enabled = True self.dropdownWidth = 'WWWWWW' self.width = 'WWWWWW' self.cb2=ComboBoxClass2()
import arcpy
import pythonaddins
class ComboBoxClass1(object):
"""Implementation for TestCombo_addin.combobox (ComboBox)"""
def __init__(self):
self.items = ["cb1item1", "cb1item2"]
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
self.cb2=ComboBoxClass2()
def onSelChange(self, selection):
pythonaddins.MessageBox(selection,"Message",0)
self.cb2.items.append(selection)
self.cb2.refresh()
def onEditChange(self, text):
pass
def onFocus(self, focused):
pass
def onEnter(self):
pass
def refresh(self):
pass
class ComboBoxClass2(object): """Implementation for TestCombo_addin.combobox_1 (ComboBox)""" def init(self): self.items = ["cb2item1", "cb2item2"] self.editable = True self.enabled = True self.dropdownWidth = 'WWWWWW' self.width = 'WWWWWW'
class ComboBoxClass2(object):
"""Implementation for TestCombo_addin.combobox_1 (ComboBox)"""
def __init__(self):
self.items = ["cb2item1", "cb2item2"]
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWW'
self.width = 'WWWWWW'
def onSelChange(self, selection):
pass
def onEditChange(self, text):
pass
def onFocus(self, focused):
pass
def onEnter(self):
pass
def refresh(self):
pass