Has anyone else experienced this? ...
For some reason, a repeater that I have put together that lists news items seems to be acting up on some computers in Firefox (update: now it's doing it in Chrome and IE too - so might not be a browser issue). It works fine on my computer, but I have at least 2 reports of people going down the list (clicking "see more") and getting to a point where the repeater stops populating and just shows my placeholders (see screen shot below).
The web page (if you want to test for yourself) is https://www.deafliteracy.ca/News. Please let me know if anyone else has the same issue in Firefox (or any other browser), and more importantly if someone could point me towards a solution.
Thanks!
Wanda
![](https://static.wixstatic.com/media/a27d24_4d99fdaa70ce4cef81d118db58f9b99d~mv2.jpg/v1/fill/w_980,h_541,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/a27d24_4d99fdaa70ce4cef81d118db58f9b99d~mv2.jpg)
I'm seeing this problem as well, and I'm not using wix code, just the built in functions. Was there any resolution to this?
Spoke too soon!
Although the glitch no longer happens - I've lost some pretty important functionality in the code. Where I tell it to either show/hide certain buttons for each of the repeater items - it's no longer working. I have two buttons (one on top of the other) - one for PDFs and one for URL links. I would hide one and show the other based on what type of link was supposed to be for each item. Now the code doesn't work at all for that part.
I'll have to return to my original (glitchy) code if I can't get this working - because at least the old code had the buttons working (even if the page didn't work properly on a direct load/refresh).
Hi Andrii,
WOW! That's it! I'm pretty new to coding like this, so I've just been piecing together what I can. This makes complete sense, and THANKFULLY seems to do the trick!
Thanks for your help!!
Hello Wanda Blackett.
You have few issues in your code.
1. You can't use $w("#repeater1").onItemReady multiple times because repeater can be ready only 1 time, when the page loads.
2. I recommend you to split your repeating code into functions.
Like this
import wixData from 'wix-data'; $w.onReady(function () { repeaterRender(); }); export function clearing_click_1(event, $w) { $w("#selection").value = null; $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "no") ); repeaterRender(); } export function selection_change(event, $w) { $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "no") .eq("type", $w("#selection").value)); repeaterRender() } function repeaterRender() { $w("#repeater1").forEachItem(($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if (dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }
I'd really love to help you find the solution! And if you would send me a copy of your website so I can try it for myself wich would be easier for me. Or you can add me as a collaborator of your Site so I can edit it, but I guess you won't thrust me or think I would mess things up.
Ok - that makes sense - or at least inasmuch as at least pointing to something that might be the cause with the head of the site refreshing. I agree - I don't see why this would cause an issue with the code. It's bizarre to say the least.
I tried playing around with your suggestion, but nothing seems to bypass the issue. I'm glad it's only happening should a user refresh the page - which hopefully won't be often. I just noticed it because I'm testing repeatedly, so I keep refreshing the page as I'm making changes.
I'll leave things as they are now - and hopefully someone will figure something out. Thanks for "talking" it out with me.
Well I had a similar problem on my WebSite. And what's happening is that if you are on your WebSite and then go to another page using a Button Linked to a Page of your WebSite it loads only the content of the page. But when you enter the page using the link it loads the head of the WebSite again and refreshes everything. I don't know how that affects your code, but apparently it does.
So I'm not sure if the following will solve the problem, but it's worth trying it!
So where you have this:
$w("#repeater1").onItemReady(() => {
Instead of using that event, use the following code:
// ... $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "archived") ) .then(() => { $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { // ...
Here's the code for the archive page - as I mentioned, it's pretty much the exact same (just changed the value for the "archive" field to "archived" instead of "no").
As a new piece of information - I've found on my computer (as well a colleague is able to replicate it on her computer) is that if you go to the https://www.deafliteracy.ca/Resources page first, changing the drop-down more than once will mess up the repeater. BUT if you click on the archive link at the bottom of the page, and then from that page use the blue arrow to return to the previous page, the drop-down works without any issues. Now - how does that happen???
EDIT: I just discovered that the glitch happens on both pages IF it's a direct open (not linked in from elsewhere in the site) or if you refresh the page - then you can see glitches when using the drop-down more than once.
import wixData from 'wix-data'; $w.onReady(function () { $w("#dynamicDataset").onReady(() => { $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "archived") ); $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); }); export function selection_change(event, $w) { $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "archived") .eq("type", $w("#selection").value)); $w("#repeater1").onItemReady(() => { $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); } export function clearing_click_1(event, $w) { $w("#selection").value = null; $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "archived") ); $w("#repeater1").onItemReady(() => { $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); }
The page you say it isn't working, works for me, and the page your saying that works for you (https://www.deafliteracy.ca/Resources/Archived) isn't working properly. Can you show me the code of that page?
Thanks for checking. It does work ok for me... until it doesn't. It's very strange how it's hit or miss if the repeater will populate properly based on changes to the filter (from the drop-down menu). I've noticed that it typically does the first change no problem, but then when I try to do another change that's when it has a hiccup.
For example, If I get to the page and choose "Resources" from the drop-down. The repeater filters fine, and shows only resources. Then, if I try changing my choice to "Reports" - suddenly it decides it doesn't like it, and all the repeater items show as the placeholders instead of the database content. Going the other way does the same - i.e. choosing "Reports" first (shows up fine), then switching to "Resources."
I have a second page that works perfectly fine: https://www.deafliteracy.ca/Resources/Archived This page has the same exact code (I know because I copied and pasted it) - with the only difference being that I've specified that for these ones only show the "archived" items - and I've said not to show them for the other page. (I have a field called "archived" in the database - I've used a text field and have typed "archive" or "no" for each entry).
Here is the code for the page that is not working (as I mentioned - it's a duplicate from the archived page, with only a slight modification). I have no idea why the archived page is working and the non-archived page is not.
import wixData from 'wix-data'; $w.onReady(function () { $w("#dynamicDataset").onReady(() => { $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "no") ); $w("#selection").value = null; $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); }); export function selection_change(event, $w) { $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "no") .eq("type", $w("#selection").value)); $w("#repeater1").onItemReady(() => { $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); } export function clearing_click_1(event, $w) { $w("#selection").value = null; $w("#dynamicDataset").setFilter(wixData.filter() .eq("archive", "no") ); $w("#repeater1").onItemReady(() => { $w("#repeater1").forEachItem( ($w, dynamicDataset, index) => { if (dynamicDataset.pdfOrLink === "pdf") { $w("#pdfBTN").show(); $w("#linkBTN").hide(); $w("#pdfBTN").target = "_blank"; } else if(dynamicDataset.pdfOrLink === "link") { $w("#pdfBTN").hide(); $w("#linkBTN").show(); $w("#linkBTN").target = "_self"; } }); }); }
It's working fine for me. Check if you have Scripts and Flash Control enabled on your Browser.
Haven't gotten any responses on this one yet... and now the glitch seems to be on another page: https://www.deafliteracy.ca/Resources
Sometimes it works just fine, and sometimes I get the repeater items showing up with the placeholders (i.e. not filled in dynamically by the database. It depends if I play around with the drop-down box to see different items... sometimes it filters just fine - and other times it will glitch on me (see example below). Does anyone know what's happening??