Template Repeater Refresh

This has been bugging me for a few days, and I can’t seem to figure out what I’m doing wrong…

I have a single window with a dropdown and a template repeater on it. When a user selects an item from the drop-down, it sets a property (“id”). The template repeater’s templateParams property is bound to an SQL query that uses the “id” property to get properties for each template from a database.

The template has three key properties that are set as parameters for the template: LabelText and UnitText, which are each bound to a label’s text property, and “MeasValue”, which is bound to the text property of a text field. The template repeater sets these values with the database query.

My problem is that the text field seems to retain its old value even when I select a new item from the drop-down. The templateParams dataset refreshes fine and the labels in the template change values, but the text field doesn’t seem to pick up the value from the dataset unless the number of rows (number of templates) changes. If I have the same number of templates but with different values for the text field, the text field doesn’t refresh.

I’ve tried everything I can think of to get them to refresh and show new values, but haven’t been successful yet. Any suggestions?

Thanks!

Hi matt,

It seems like a bug to me. For a workaround what if you did the following:

Remove the binding from the “MeasValue” parameter to the text field. Add a propertyChange script to the template that changes the Text Field “text” property when the “MeasValue” parameter changes. Here’s an example of such a propertyChange script on the template:if event.propertyName == "MeasValue": textField = event.source.parent.getComponent("Text Field") textField.text = event.newValueAs a note, it would be good to send what you described to IA support so if it is a bug they can get it fixed.

Best,

Hmm…even that workaround doesn’t seem to work. I even created a blank, simple demo to check my sanity. No luck. I’ll forward this on to IA support.

Thanks!

I am experiencing this as well.
Row count must change in order for the templates to “refresh”.

I found you don’t need to actually change the repeat count, just write the same number to it and it refreshes.
count = event.source.parent.getComponent(‘Template Repeater’).repeatCount
event.source.parent.getComponent(‘Template Repeater’).repeatCount = count