I obviously don’t know enough about dataset and attributes of components, so I need some help.
I have a flex repeater with the path set to a view with a checkbox. I have a button that is intended to step through the text boxes and see which ones are selected. If I look at the Instances parameter on the flex repeater with logger messages:
Instances = self.getSibling("FlexRepeater_Obj").props.instances
logger.info("list" + str(Instances))
logger.info("list[0]" + str(Instances[0]))
i get:
list<ArrayWrapper>: [<ObjectWrapper>: {u'text': u'dan', u'selected': False},
<ObjectWrapper>: {u'text': u'jill', u'selected': False}, <ObjectWrapper>:
{u'text': u'NOTA', u'selected': False}]
list[0]<ObjectWrapper>: {u'text': u'dan', u'selected': False}
Now what I want to do is look at each column in Instances[0]. I assume I would index this at Instances[row][column]. However, when I try to look at Instances[0][0] like this:
Instances = self.getSibling("FlexRepeater_Obj").props.instances
logger.info("list" + str(Instances))
logger.info("list[0]" + str(Instances[0]))
logger.info("list[0][0] " + str(Instances[0][0]))
i get an error on the last line:
list<ArrayWrapper>: [<ObjectWrapper>: {u'text': u'dan', u'selected': False},
<ObjectWrapper>: {u'text': u'jill', u'selected': False}, <ObjectWrapper>:
{u'text': u'NOTA', u'selected': False}]
list[0]<ObjectWrapper>: {u'text': u'dan', u'selected': False}
Error running action 'dom.onClick' on
View_001@C$0:1/root/Button_CastBallot: Traceback (most
recent call last): File "<function:runAction>", line 14, in runAction
KeyError:0
How do I reference the ‘selected’ column in each row to see if the value is true or false? I have tried toPyDataSet() and toDataSet() but neither helps.