Hi,
I have few flex repeaters that have almost 44 instances on each of them. I created these instances and their related parameters by using a script and assigning them to the instance property of the flex repeater.
But, I need to bind every parameter in the flex repeater instance to the a the value of a radio button on the same view. Currently, I'm doing this by creating the binding manually on the parameter of one of the instances and them using copy-paste binding to have the same binding on other instances as well. This is very repeatative task. Is there a way to do this by writing a script?
If this is not possible, I might go with using a message handler to update the parameter on the view directly which is getting rendered on the flex repeater on value change of the radio button.
Use custom properties to expose the bindings outside of the flex repeater:
-
Bind the value of the radio button to a custom property on the flex repeater. This will be a single source of truth for the flex repeater.
-
Bring in all other variables that are dependent on the radio button to a custom property and create bindings on each of these values in a form that will be useful in your instance generation script. This has the added bonus of making debug of these values much easier as opposed to having the bindings buried in the flex repeater instances.
-
If necessary, add a change script on the newly added radio button custom value to update the bindings and/or re-generate the flex repeater instances.
Since you already have the instance generation script it should just take a little tweaking of the same script depending on the radio button value.
I think I may have given the wrong impression. The instance generation script is only run once during development and is not executed as part of the project at runtime. However, the radio button values can change in the UI, and those changes need to be reflected in the Flex Repeater instances.