Add setValue to listview items

textinput1.setValue() works great, but if a field is inside of a listview you cannot use this command on textinput1[index]

You’re right, setValue() doesn’t work inside of listviews. It’d be nice if it did, and I logged the feature request, but unfortunately I doubt we’ll add this in the next couple of months

Fwiw we’re adding a few awesome people to our engineering team over the next few months, so hopefully these improvements will be easier to prioritize in the near future. We all really appreciate your reporting stuff like this!

I’d add another vote for this. Would be nice to have setValue work on ListView elements

Hey everyone! Just checking in here. (As you may or may not have noticed by now, ) JS functions are now supported in our Listview components. :tada: Thank you all for your feedback, and happy Retooling!

3 Likes

hello!! @victoria can you give me an example, if i want to setValue for a specific checkbox or numberInput inside a listView. How can i do that ??

@rdurante

You can do:

numberInput[index].setValue(1000)

where the index is the row you want to update that component for. Hope that helps!

1 Like

i'm getting error "itemImage[item].setValue is not a function"

I try to set the value from one modal to the input fields of Listview of another modal.
first modal

2nd modal

Hi @Pradip_Kumar_Parkar

Can you share a screenshot of the state information for itemImage?

Thanks for sharing all of the other details!

Hi Tess,
I'm facing the input fields of nested listview, setValue is working fine in till (n-1) items.
sectionListview(parent listview)
--itemListView(child listview)
-- Inside child listview, there are 15 rows and each row has 5-6 input fields,

I'm trying to set the value of the 3 input fields of each row. The names of the input fields are
subKey, childDataType,childSubcomponentId
there is an add button which adds the new child listview with input fields inside the parent listview.
So if the number of child listviews is 2 then the value will be set in the first child listview input fields.

ChildListview =2
value is set only
subKey[0][0]
subKey[0][1]
.
.
subKey[0][11]
same for childDataType, childSubcomponentId

and if ChildListview =3

value is set only
subKey[0][0]
subKey[0][1]
.
.
subKey[0][11]
subKey[1][0]
.
.
.
subKey[1][11]

same for childDataType, childSubcomponentId

console.log("456");
 await sleep(100);
  var childKeyList = childSubcomponentList.data;
  var temp = sectionCount.value;
  console.log("temp-"+temp)
  await sleep(100);
  var newTemp =temp+1;
  sectionCount.setValue(newTemp)
   await sleep(100);
  // var count =sectionCount.value;
  console.log("count-"+newTemp)
  childSubcomponentCount.setValue(childKeyList.length)
  for(m=0;m<newTemp;m++)
  { 
    await sleep(1000);
    for(item=0; item<childKeyList.length;item++){
      console.log(m+","+item);
      // console.log(subKey[m][item].setValue(childKeyList[item].subcomponent_name))
       await sleep(100);
    subKey[m][item].setValue(childKeyList[item].subcomponent_name);
    childDataType[m][item].setValue(childKeyList[item].type);
    childSubcomponentId[m][item].setValue(childKeyList[item].subcomponent_id);
      await sleep(100);
  }  
  }
function sleep(ms) {                                                                                                                                                                                       
  return new Promise((resolve) => setTimeout(resolve, ms));                                                                                                                                                
}   

console log


Also, the console log does not appear on the console box that's why I'm using sleep
please help with this