Forum Discussion
Does this approach also work, if I define the pagination by myself?
Currently I used the code below (with a more complex custom component) and try to append this to my page.
<#-- Setting page size --> <#assign page_size = 10 /> <#-- Getting page number from URL, default = 1 --> <#assign page_number = webuisupport.path.parameters.name.get("page", 1) /> <#-- Getting all recent messages --> <#assign messages = rest("/topics/recent?restapi.response_style=view&page_size=" + page_size + "&page=" + page_number).messages.message /> <#-- Getting total number of results --> <#assign result_list_size = rest("/topics/recent/count").value /> <#-- Pagination configuration options --> <#-- setPagingMode has a few different options (see FM context objects) --> <#assign pageable_item = webuisupport.paging.pageableItem.setCurrentPageNumber(page_number).setItemsPerPage(page_size).setTotalItems(result_list_size?number).setPagingMode("enumerated").build /> <#-- BEGIN - Custom Component code goes here - BEGIN --> <ul class="message-list"> <#list messages as message> <li class="message-item"> <#-- Message Content --> Item </li> </#list> </ul> <#-- END - Custom Component code goes here - END --> <#-- Pagination component using the config we defined above --> <@component id="common.widget.pager" pageableItem=pageable_item />
Defining the pagination yourself shouldn't change anything.
It might help if you explain why you need to use jQuery to append the pagination component. Normally you just insert your custom component into the appropriate location on the page or inside another component.
- cike11 years agoChampion
I've got three custom components which will be displayed using a tabbing navigation. Each of these components uses a custom pagination.
If I put these three component into my page, the pagination logic of one component will collide with the others, because they using the same "page"-parameter.
My approach was to only load one component, depending on the selected and active tab and to remove the others.
- nathan11 years agoExecutiveWell, you can use JavaScript/jQuery to hide the pagination components of the inactive tabs (or indeed the whole content of the active tab). To do this you just need to wrap the content you want to hide in a div tag (or similar) with an ID which is unique to the tab.
However, if you've got a problem with conflicting pagination logic, it's unlikely that just hiding the content will fix the problem.
It's hard to know what to suggest without seeing the whole thing.
Related Content
- 4 years agoInactive User
- 7 months ago