// handle each suggestion repeater item
//console.log(“inside onReady”)
$w(“#repeater2”).onItemReady( ($w, itemData, index) => {
const text5 = $w(“#text52”);
text5.text = itemData.text5;
const text4 = $w(“#text53”);
text4.text = itemData.text4;
});
$w(“#repeater2”).collapse(); // hidden on page load
});
I am getting
Wix code SDK Warning: The text parameter of “text52” that is passed to the text method cannot be set to null or undefined.
Wix code SDK Warning: The text parameter of “text53” that is passed to the text method cannot be set to null or undefined.
My site address is sauravgarg540.wixsite.com/mysite . Can please someone help me removing this error?
$w(" #repeater2 “).onItemReady( ($w, itemData, index) => {
$w(” #text52 ").text = itemData.fieldKey // fieldKey needs to be the fieldKey in your data collection
});
When working with repeaters remember that itemData will hold your data collection values and the elements id #text52 is the ID of the text element in your first item in your repeater.
Thanks Andreas Kviby for helping me.
My code is:
$w.onReady( function () {
// handle each suggestion repeater item
//console.log(“inside onReady”)
$w(“#repeater1”).onItemReady(($w, itemData, index) => {
const text1 = $w(“#text51”);
text1.text = itemData.text1;
const text2 = $w(“#text54”);
text2.text = itemData.text2;
});
$w(“#repeater1”).collapse(); // hidden on page load
//$w(“#repeater2”).hide();
//handle each location detail line
// retrieve saved location (if exists) from local storage
let id = null
if (id === undefined || id === null || id.length === 0) {
// if no location saved, find the IP-based geographic location
geoloc();
}
});
$w.onReady( function () {
// handle each suggestion repeater item
//console.log(“inside onReady”)
$w(“#repeater2”).onItemReady( ($w, itemData, index) => {
const text3 = $w(“#text52”);
text3.text = itemData.text3;
const text4 = $w(“#text53”);
text4.text = itemData.text4;
});
$w(“#repeater2”).collapse(); // hidden on page load
});
I am not getting the error for repeater 1. Code is same for repeater 2 but I am getting the error in repeater 2. Can you please look into the code.