Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
Hi,
I am currently working on a project where we want the pageNumber to be controled via a session variable.
When for example selecting an item and then clicking back, we want the last viewed pagination page to show. The property pageNumber is updated correctly when switching pagination page. But when clicking an item and back, it is not taking into account the last pagination page,
How to solve this?
// Oskar Berntorp
Solved! Go to Solution.
Step1: Create a session parameter to hold the last visited page number.
Create a property in ThingShape:GlobalSessionProperties say "LastVisitedPage" of type number.
Step2: Create a service to update the last visited page that triggered by PageNumberChanged event of the pagination widget.
Step3: Create a service to fetch the last visited page and bind the output to PageNumber property of the pagination widget.
Step4: Bind the ServiceInvokeCompleted event of the service that returns Total # of results and page size to GetPageNumber service that created in Step 3
This is important because if you trigger the GetPageNumber service on Mashup loaded, the page number cannot be passed onto pagination widget successfully as without knowing the total number and page size, the pagination widget don't know how many pages it can have and will regard the passed PageNumber is invalid which lead to page number being 1
Step1: Create a session parameter to hold the last visited page number.
Create a property in ThingShape:GlobalSessionProperties say "LastVisitedPage" of type number.
Step2: Create a service to update the last visited page that triggered by PageNumberChanged event of the pagination widget.
Step3: Create a service to fetch the last visited page and bind the output to PageNumber property of the pagination widget.
Step4: Bind the ServiceInvokeCompleted event of the service that returns Total # of results and page size to GetPageNumber service that created in Step 3
This is important because if you trigger the GetPageNumber service on Mashup loaded, the page number cannot be passed onto pagination widget successfully as without knowing the total number and page size, the pagination widget don't know how many pages it can have and will regard the passed PageNumber is invalid which lead to page number being 1