2011-11-23, 10:45
I'm using List Container with static content as dropdown list for holding a list of options.
But, from within python, I cannot access list items?!
For dynamic populated list there is no problem, since I'm using this, but this is the first time that I need to access items of static content list.
For example...
...
...
In python script I have method which selects item on this list based from the data from database.
But listControl.size() return 0 (zero) for this list.
Anybody have a clue??
But, from within python, I cannot access list items?!
For dynamic populated list there is no problem, since I'm using this, but this is the first time that I need to access items of static content list.
For example...
...
Code:
<content>
<item id="0">
<label>$ADDON[script.tc 2069]</label>
<onclick>-</onclick>
<visible>true</visible>
<property name="recure_type">once</property>
</item>
<item id="1">
<label>$ADDON[script.tc 2065]</label>
<onclick>-</onclick>
<visible>true</visible>
<property name="recure_type">daily</property>
</item>
...
In python script I have method which selects item on this list based from the data from database.
Code:
def select_list_item_by_property(self,controlId,propertyName,propertyValue):
listControl = self.getControl(controlId)
for itemIndex in range(0,listControl.size()):
listItem = listControl.getListItem(itemIndex)
listItemPropertyValue = listItem.getProperty(propertyName)
if propertyValue == listItemPropertyValue:
listControl.selectItem(itemIndex)
But listControl.size() return 0 (zero) for this list.
Anybody have a clue??