I have a function createWidgets whose purpose is to take a list of strings and create a list of containers for each string -> 1 container = a textbox and checkbox. Each container is then put into a large container.
What I am trying to do is append a button to the container that on_click takes all the "True"s and puts all the modified strings and puts them in a dataframe
widgelist = e.options
txtBox_type = 'text_widget' # Define if Area box o regular txtbox
bigContainer = createWidgets(widgelist, txtBox_type)
Function
def createWidgets(widgelist, txtBox_type):
#containerList = []
i = 0
for k in widgelist:
## Build Container widgets
chBox_Widget = widgets.CheckboxWidget(description = str(i),value = False,)
if txtBox_type == 'textA_widget': # Check wether txtBox should be an area txt box or not.
txt_Widget = widgets.TextareaWidget( description = str(i), value = k)
else:
txt_Widget = widgets.TextWidget( description = str(i), value = k)
container = widgets.ContainerWidget()
container.children = [chBox_Widget, txt_Widget]
containerList.append(container)
i+= 1
button = widgets.ButtonWidget(description = 'Add')
bigContainer = widgets.ContainerWidget()
bigContainer.children = containerList
return bigContainer
I have gone to many websites and spent many days on this help is very much appreciated