Accessing Repeat ID onClick

Hello!
I’ve got a container that repeats. It shows a list of Financial policies (well, the title of each policy).

I’d like to make it so that when when a user clicks on the policy a modal pops up and displays the entire thing. Seems easy enough.

But, for some reason I cannot access the dynamic value of each database ID in the “Click” event.

You can see here that it will show me the server connect that is being repeated… but the only value I can pull is rte_ListFinancialPolicies.sc_FinancialPoliciesListed.data.query_ActiveFinancialPolicyList.data[0].FPolicy_ID which is going to pull up the same policy ever time because it’s the [0] in the list.

image

I was able to add the name of the policy by putting {{FPolicyName}} in the text. But, I can’t even find that in the expression or bindings area.
Trying to insert {{FPolicyID}} into the on click didn’t work, either.

In the server connect you have a _ in this name

Also if you scroll further down the binds further is there nothing listed as repeat1 as the repeated data should be accessed from repeat1 not the server connect?

Yes, you’re correct about the _ there. Once I put that in I got it to work manually.

But, still curious about the binds.

“if you scroll further down the binds further is there nothing listed as repeat1 as the repeated data should be accessed from repeat1 not the server connect?”

Yeah, “repeat1” is not listed there. Which is what I was expecting.

I went ahead and searched for “repeat” in the binding menu so you could see.
One shows up but that’s from a different route.
Do you think having a same-named repeat on a different route could affect that?
edit: I renamed my repeat, still doesn’t show up

image

Okay I just did a quick test when you apply the repeat to a container using the repeat attribute it shows up when you hit the binds. When you add a id aswell it no longer pops up in the bind menu for me at least. Could you try removing the id of the container (if its not needed) and then refresh the app structure and see if it opens the container in the bind menu.

Removed the ID of the container that had the repeat attribute.
image

Click on the reload page app structure a couple times
image

Still doesn’t show up in the bind menu.

image

Try without typing repeat in maybe just add a temporary paragraph and see if it opens straight to it for me it opens but it doesn’t display a name or id etc

Another option is to add a row inside the container and then convert the row to a repeat or use the repeat/repeat children components inside the container.

1 Like

LOOK AT THAT!!
Thank you @Sorry_Duh!! :grinning:

If I don’t search for a repeat, and if I give it an ID, it’ll show up in the bind.

image

I think this is probably an error. I’m running Wappler 4.9.1 right now, instead of 5. But, maybe @Teodor wants to see this?

1 Like

Glad its working :slight_smile: and yes one for the team to confirm normally I don’t use the repeats added to elements so not sure how exactly it’s supposed to function most of my repeats are rows converted to repeat rows etc or the actual repeat components.