Forum Discussion

cike's avatar
cike
Champion
11 years ago

Custom Pagination in endpoint links to "unknownpage"

Hey,   I developed a custom components including a custom pagination like this: http://community.lithium.com/t5/Developers-Discussion/Implement-custom-pagination/m-p/106695/highlight/true#M3927   ...
  • nathan's avatar
    11 years ago

    If you use the page URL to embed the page number, you'll need to use a different parameter name for each component. You could do this with a simple prefix.

     

    For example, the URL for you page might be:

    http://community.lithium.com/t5/Knowledge-Support/ct-p/knowledgeandsupport?comp1_page=1&comp2_page=3&comp3_page=2

     

    However, this starts to look very messy, and you have to persist all the parameters when changing page for just one component.

     

    A better approach is to use JavaScript inside the component to call the REST API (or a custom endpoint if appropriate) and update the HTML content of the component. The next/previous links will need to execute a JavaScript function to get the next/previous page of data and update the content.