Setting the link property on an image in a repeater doesn’t work

Hi –
I am trying to programmatically set the contents of a repeater. It is working fine except for the link on the images in the repeater. Based on a trace via the console I can see that the links are set correctly, they just aren’t being recognized. Am I missing something or is this a bug?
You can see the issue on my simple test site at https://bigenginespc.wixsite.com/test2 . It has two identical repeaters, the first built completely in the editor and the second built with wix code. If you look at the console you’ll see that the properties of both are identical, including link src, yet the links fire on the regular repeater but not the coded repeater.
Any suggestions would be much appreciated. Thank you!
The code looks like this:

$w.onReady( function () {

logRegularRepeater(); 
setCodedRepeater(); 
logCodedRepeater(); 

});

function logRegularRepeater() {

console.log("********** REGULAR REPEATER **********"); 

$w("#repeaterRegular").forEachItem(($item, itemData, index) => { 
    console.log( 

“Index: " + index + “\n” +
“Label: " + $item(”#labelTextRegular”).text + “\n” +
“Image source: " + $item(”#shapeVectorRegular").src + “\n” +
“Image link: " + $item(”#shapeVectorRegular").link + “\n” + “\n”);
});

}

function setCodedRepeater() {

const codedRepeaterData = [

    { 

“_id”: “item1”,
“labelText”: “First Item”,
“shapeSource”: “wix:vector://v1/8463f60718194af748c49dddbe45b668_svgshape.v1.HollowCircle.svg/8463f60718194af748c49dddbe45b668_svgshape.v1.HollowCircle.svg”,
“shapeLink”: “/page-1”
},
{
“_id”: “item2”,
“labelText”: “Second Item”,
“shapeSource”: “wix:vector://v1/9cca9e9c03ec45e28cb046998aedd32d.svg/Triangle.svg”,
“shapeLink”: “/page-2”

    }, 
    { 

“_id”: “item3”,
“labelText”: “Third Item”,
“shapeSource”: “wix:vector://v1/909695c1e003409ba70b5561666c7c4d.svg/Square.svg”,
“shapeLink”: “/page-3”
}

]; 

$w("#repeaterCoded").data = codedRepeaterData; 

$w("#repeaterCoded").forEachItem(($item, itemData, index) => { 
    $item("#labelTextCoded").text = codedRepeaterData[index].labelText; 
    $item("#shapeVectorCoded").src = codedRepeaterData[index].shapeSource; 
    $item("#shapeVectorCoded").link = codedRepeaterData[index].shapeLink; 

}); 

}

function logCodedRepeater() {

console.log("********** CODED REPEATER **********"); 

$w("#repeaterCoded").forEachItem(($item, itemData, index) => { 
    console.log( 

“Index: " + index + “\n” +
“Label: " + $item(”#labelTextCoded”).text + “\n” +
“Image source: " + $item(”#shapeVectorCoded").src + “\n” +
“Image link: " + $item(”#shapeVectorCoded").link + “\n” + “\n”);
});

}

Hi Tim,

I have a similar problem here: https://www.wix.com/corvid/forum/community-discussion/setting-link-property-of-repeated-vector-image?origin=member_posts_page

did you solve your issue?

From what I understand from he API reference, setting a repeater.data property with your own array does fire the onItemReady events for each item, based on the content of the set array (check my post for details) → did you try that instead of using forEachItem?

Thank you, I will check it out and let you know!

This is an old post, please note that bumping up old posts is against the Community Guidelines , please open a new post with your own problem.

the old post is deleted Ahmad