<div data-role="container" id="catalog-container">
<ul id="catalog-item-list" data-role="listview">
<th:block th:each="item: ${catalog.content}">
<li><a th:attr='href=${"editrequest/" + item.catalogItem.id}'>
<img th:attr='src=${"catalogicon/" + item.catalogItem.iconId}'/>
<h2 th:text="${item.catalogItem.name}"/>
<p th:text="${item.catalogItem.description}"/>
</a></li>
</th:block>
</ul>
<div data-role="footer" class="bsp-paginator">
<input type="text" data-role="spinbox" data-options='{"type":"horizontal"}'
name="catalog-page" id="catalog-pager" min="1" th:attr="max=${catalog.metadata.totalPages}, value=${pageNumber}"/>
</div>
</div>
<script>
$(document).on("change", "#catalog-pager", function(event) {
console.log(event.target.id)
changeListPage(event, 'catalog', '#catalog-item-list', event.target.value, 2)
})
</script>
function changeListPage(event, file, parent, value, size) {
event.preventDefault()
$.ajax({url:file + "?limit=" + size + " + &start=" + value, success: function(response) {
$(parent).replaceWith($(response).find(parent))
$(parent).enhanceWithin()
}})