Unable to Implement Next Page In Repeater

I have a repeater that displays 12 items at a time from a dynamic dataset using a Pagination widget. This works as expected.

I also allow Searching on this dataset for a String in the Subject field. By default, if you use pagination on a search, clicking the next page will show you the next item in the database regardless of whether it matches the search string.

To get around this I am setting a Session Variable to the Date field of the items in the search. When a search is initiated via a Search Button next to the Search input field, the Pagination is turned off and replaced with a next button. The initial Search produces the expected results.

The “Next Match” button function gets the Session Variable and uses it in a new search.

I have implemented this in another page and it is working as expected but this one returns NO data even though I know it is there. See the two screen shots … one with search limit set to 6 and the other one set to 12. With it set to 6, the Next page should show messages beginning with #5625 on…


with search limit set to 12…

Here is the code:
export function repeater1_itemReady($w, itemData, index) {
let itemEmail = itemData.email;
let itemMsg = itemData.msg;
session.setItem(“Next”, itemMsg);
console.log(“REPEATER READY MSG: “, itemMsg)
let itemSeq = 1;
$w(”#repeater1”).show(); //JDS
}

export function searchButton_click(event) {
$w(“#pagination1”).hide();
$w(“#searchingGif”).show();
$w(“#repeater1”).hide();
$w(“#nextPage”).show();

Search = $w("#searchField").value 

	wixData.query('CVOA-Yahoo-Board') 
	    .contains('subject', Search) 
		.limit(6)                                                                 
		.ascending('date') 
		.find() 
		.then(res => { 
			$w('#repeater1').data = res.items; 
			$w("#searchingGif").hide(); 
			$w("#repeater1").show(); 
    }) 

}

export function nextPage_click(event) {
let last = session.getItem(“Next”);
console.log(“next: “, last)
wixData.query(‘CVOA-Yahoo-Board’)
.contains(‘subject’, Search)
.gt(“msg”, last)
.ascending(‘date’, ‘msg’)
.limit(6)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
$w(”#repeater1”).show();
})

}
------------------------
As you can see, I am console logging the sessionSet and sessionGet… on the “nextPage” I do see it should be continuing search from previous search. F12 shows no errors in the java console.

As I stated, I have another page where this works perfectly. I cannot seem to find out the difference. In fact, I copied that code and changed it to match this page, still same results (or lack thereof) on the “nextPage”…

Please help!
Thanks
JD

Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.

https://editor.wix.com/html/editor/web/renderer/edit/502ab463-278b-4359-a626-a94fce2a7bf3?metaSiteId=7d563bd4-a185-46a0-aee9-788f4850772f&editorSessionId=a3cb17c1-b187-4091-9a67-d98dbb3d53bb&referralInfo=dashboard

Page Name: CVOA-Yahoo-Board

Thanks

You say that this works on another page. What page is that?

“the-cv-registry” page works when you seach by color

Also, while you are looking at this… the Pagination does not display the total pages as it should… perhaps hit a limit? There are 28002 records and pagination is showing 12 at a time. See Wix Support Ticket 923639499

Thaks
JD

From what I see (and it’s a lot of code to look at) is that you are both 1) binding your Repeater to a dataset, and 2) setting the contents of the Repeater with a query. I can’t really say what the conents of the Repeater are in the end.

You will need to be consistent and either perform the filter/search on the dataset, or perform the filter/search using a query directly on the collection.

Thanks for taking a look. I have eliminated the need for the Next button by just setting the limit to 100 items. Since the other page “The Repeater” is setup the same way…(initially fields populated by binding and query fields by query) and it has been running fine for 3 year, I am leaving it the way it is.