Template Repeater getLoadedTemplates empty array issue

I have this scenario, when i execute the getLoadedTemplates on template repeater, i have empty array for every result.
how can i detect if the template repeater is ready so that i can execute the getLoadedTemplates?

Appreciate any help.

[code]import time

def onShit():
return event.source.getLoadedTemplates()

if event.propertyName == “templateParams”:
#print len(event.newValue)
pydata = system.dataset.toPyDataSet(event.newValue)

for row in pydata:

print row

templateList = onShit()#event.source.getLoadedTemplates()
print templateList
#templateList = tempData.getLoadedTemplates()
#print len(templateList)
for index,template in enumerate(templateList):
	#find a component named "Label" in the instance,
	#and print the value of the text property 
	template.getComponent('CheckBox').text = str(pydata[index][0])[/code]

Hi,

You might try executing your code later. Something like this:

[code]import time

def onShit():
return event.source.getLoadedTemplates()

if event.propertyName == “templateParams”:
#print len(event.newValue)
pydata = system.dataset.toPyDataSet(event.newValue)

for row in pydata:

print row

def func():
templateList = onShit()#event.source.getLoadedTemplates()
print templateList
#templateList = tempData.getLoadedTemplates()
#print len(templateList)
for index,template in enumerate(templateList):
#find a component named “Label” in the instance,
#and print the value of the text property
template.getComponent(‘CheckBox’).text = str(pydata[index][0])
system.util.invokeLater(func)[/code]Best,

This does not work for me… unless I’m doing something different than you.
My issue is inverse. I start of with 10 records, and then set templateParams to an empty dataset, which comes over as templateParams count of zero, but blah() func still shows a count of 10.

def blah():
	logger = system.util.getLogger("diner.op.repeater")
	logger.debug("later on... the count is... " + str(len(event.source.getLoadedTemplates())))

if event.propertyName == "templateParams":
	logger = system.util.getLogger("diner.op.repeater")
	logger.debug("property-change templateParams.count = " + str(event.newValue.getRowCount()))
	if event.newValue.getRowCount() == 0:
		logger.debug("calling onRepeaterReady()")
		#system.util.invokeLater(event.source.OnRepeaterReady)
		system.util.invokeLater(blah)