I am trying to populate some data inside of a view in a flex repeater from an API. I have two parameters I need to pass in order to retrieve the data from the method. (loadNum, plant). Is it possible to use an expression structure to pass the payload data from the view into the repeater?
Do you mean an expression structure binding ?
What do you have in mind ? It's difficult answering this without more context.
- In the Load Picking View that houses my tabbed containers I have created some params that I planned to use to pass data to the Supervision Tab View.
2.Inside of one of my tabs (Supervision Container) I have a repeater that is referencing another view as a “template”.
3.Inside of that “template view” (Supervision Template View), I have some params that are binded to labels to populate data in those areas.
-I'm trying to find the best way to pass data into the nested containers from the API I have to reference. I need to pass two parameters (plant and loadNumber) to get back the data I need from the API. I created a custom method inside of the root container of my Load Picking View, but I'm also wondering where would I need to call my method in the repeater or the template view. I had assumed the repeater…
Normally I would make a binding on the instances
parameter in the flex repeater and get the list of parameters you will need to pass and generate an array of instances with the contained parameters using a script transform in this binding, then you will have a flex repeater with unique instances.
One example of this type of binding is:
I would recommend doing what @David_Stone is suggesting. It's easier than it sounds.
Create a few static instances of your template inside the flex repeater. Copy/paste the "instances" node into a text editor to see what the JSON looks like to create those instances. Then you just do a binding with a script transform to build your instances. You can do this dynamically based on whatever data populates your templates. The binding should point to whatever it is you want to use to refresh your instances (the trigger).
Another thing to consider is that it is possible to pass a lot of parameters into a template, but you can encounter performance problems if you are passing a large number of parameters into a template and generating a large number of instances.
You can optimize these bindings by making your template use indirect bindings off a partial tag path that is passed in as a parameter. So you have one parameter that is used to create indirect bindings to UDT instances to get all the data. It's much faster than passing a ton of parameters. The UDT is used to structure the data so your templates work nicely.
Ok. So, I can capture my data from the API on the flex repeater, directly on the instance properties? instead of the view template that it is referencing?
Essentially yes.