ListView sub compenent item change value

Hello,

I am trying to have add a component where the user can edit a list. Right now I have the list populate from a SQL query and then have two buttons to either pick from a dropdown (and add a new line) or add a new line and manually enter. Once clicked, I have JS query running to change the value, but cant quite get it to work. I need the latest added indexed item (realEstate3 or -1) value to change.

Oddly enough, when I do categories_realEstate_input[5].setValue("test") it works, but when I try and pass a variable into the index, it doesn't work.

Note. The TextInput is inside of a listview component, such that each integer of realEstate3 will add a new TextInput component.

Screenshot 2023-11-20 at 3.00.55 PM

Hello you can try the following

textInput[listView1.instances-1].value

Animation

or textInput[listView.instances-1].setValue()

1 Like

Hmm... That worked!

I had to separate the instance modification (+1) and the setValue, since there seemed to be a delay in adding the new instance before setting the value--which ended up causing the second-to-last instance getting the value.

1 Like

It looks like that only partially worked. I keep getting a repeating problem where it is taking the second-to-last entry. I added a wait function with a 10 second delay and it still has this issue oddly enough.

Hello, you can do this instead
image

textInput1[listView.instances].setValue()

and a debounce of 100ms

Edit: actually debounce is not necessary
Animation

Thank you!

I'm not sure why, but when I tried using the control component before, the index option did not show up.