Custom filter widget - how to retain the filter after being redirected to another page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 01:41 AM - edited 02-11-2025 01:53 AM
Hi,
We have a custom filter widget on the service portal, the filter widget shows the desired records depending on the filter conditions.
Upon clicking the desired record, the page redirects (so no pop-up) to the record. When pressing/going back, the filter's reset again.
Is it possible to have the filter saved even when going back? If so, how?
Filter:
Redirect to new screen
Go back, filter's reset
Any help would be greatly appreciated!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 03:22 AM
For values like this, you can cache the value in the browser. You have two options, session storage and local storage.
Session Storage exists for the duration of the user session, so if they expire or logout the data is lost. Local storage persists.
//Retrieve a value based on 'itemKey'
$window.sessionStorage.getItem('itemKey');
//Save a value based on a 'itemKey'
var myFilterValue = 'active=true';
$window.sessionSotrage.setItem('itemKey' , myFilterValue);
You could also look to bring in a directive such as ngStorage