If you do not want to save the request in the SearchSession
, you will need to resubmit the form. Create a JavaScript function like this:
function nextPage(pageNum, requestChainToken) { document.searchForm.requestChainToken.value = requestChainToken; document.searchForm.goToPage.value = pageNum; document.searchForm.submit(); return false; }
You can then invoke the function when the user clicks on a link for a specific page:
<a href="#" onclick="return nextPage('<%=pageValue.toString()%>', '${formHandler.searchResponse.requestChainToken}');"> <dsp:valueof param="count"/> </a>
When the link is clicked, the page number associated with the link and the requestChainToken
of the current search response are passed to the function. The function uses these values to set the goToPage
property and the requestChainToken
property of the form, which it then submits. In addition to specifying the results page to display, this ensures that the same requestChainToken
value is associated with each subsequent search request.