I have an input field that is repeated and when I press a button I’d like to append the input field value to a list (see below images. Container 1 is repeated and contains a nested list, input, and button).
this keyword to refer to a specific element in a set of repeated elements. Does AppGyver have a similar concept?
Hi John, thanks for your reply but I’m not sure it would work. Here’s my reasoning (correct me if I’m wrong):
current element is simply tied to the collection returned by my data variable (in the example this collection is called
current element doesn’t have any knowledge of the input field in the UI.
You’re repeating it as
bar so it’s under
current is just there as a helper and bridge to legacy implementation of repeats. It’s also under
repeated.current but only the default name current has this alias shorthand.
I see what you mean and I’m struggling with this now. Have you been able to figure this out?
Actually not. Because, in that example, there’s no changing input in the repeated container. The value “+1” which is added is inside the formula and static.
Here, it would be the case of allowing the user to change a value of the repeated container through an input which is inside it a given repeated container.
The “current” method gets only the repeated data properties, but not the value from the repeated input.
Hi @Ruy_Mello did you figure this out yet? So it depends on your implementation but lets assume you want to use the onChange event to set the input to a variable. You bind the input to the repeated item that corresponds to variable you want to store or read from. Then you need to set up the onChange event. Use a MAP function to Locate and SET_KEY to the prop/key and the value would be the output from another node ==> outputs[“Component onChange”].eventValue. Hope this helps
Thanks, @Dika_Oha! That helped me out!
For future reference, should anyone take a look at this post, to enable the onChange event, I had to convert the input field into a container. See “Dropdown logic please” for reference.