Friday, April 10, 2009

How to reset Page Navigation Component to render the contents from first page in local rendering portlet

How to reset Page Navigation Component to render the contents from first page in local rendering portlet



Cause
Since using the same paging component across multiple navigator or menu components , the paging component itself is not being updated, the paging component will maintain its state until it gets specifically told to update by a URL request.

While clicking on a paging link, it will have information in the URL about which page to display. With this information in the URL, the paging component can update to display the next page, previous page, etc
Now , if a specific request to the page comes in, and the URL does not have any paging parameter information, the page element will not be changed.

This is not a problem if the paging elements are not being shared, because each paging component when it is first rendered will start at page one, and then hold the page information in the session.

So in this case, while clicking on a link to a piece of content, and the portlet is updated, since the links are clicking does not have any paging information, the paging component will not be updated, and will always renders the contents from last selected page.

Answer
In order to reset the page navigation component and force page navigation component to render from first page , the parameter WCM_Page.ResetAll=TRUE can be appended as querystring while generating links into page navigator component design.

For example
&WCM_Page.ResetAll=TRUE" >

This parameter will reset the page navigation component and it always start rendering from first page.