ReactiveSearch (Web): Pagination gets reset once returning to same page - reactjs

I am working on ReactiveSearch, in which I am using URLParams to maintain search selections of user through route changes.
When on any page other than first, after refreshing browser, user gets on that page,
but once user change the page and visit same page again, by click on pagination, it redirects user to first page rather than that page.
On Sandbox here, if you refresh page after navigating to Page 3, and do navigation by going to Page 2 and again to Page 3, you will be redirected to Page 1.
Is there any work around I can fix this till issue gets fixed?
Thanks.

They have updated their repo now and above issue is resolved.

Related

How to trigger hard refresh when redirecting to a different page in Next.js?

I have a <Link> to a certain page on my Next.js website. Upon clicking it, I want the webpage to hard reload after it redirects to the destination page (whether it reloads before or after the redirect is not important). I have tried using router.push as well but a hard refresh does not occur. Any help would be appreciated.
If you want to refresh the page on load use simple anchor tags,
if you want more control over reloading the page,
Refer this:
https://nextjs.org/docs/api-reference/next/router#routerreload

$state.go in AngularJS is not working on sub menu

I have a problem related to AngularJS $state.go(url). I have a list of menus, only one of them has Sub-Menus. When I log in and I click on any other menu, it properly redirects to the desired page. Even if I click on the Menu having sub-menus, the desired page is opened, but when I click on any of the sub-menu under it, the page is not redirected. Here is the menu with submenus:
However when I refresh that page, even before clicking Form 1 menu item, the submenus start to redirect on clicking.
I have put console.log before and after $state.go function and that is being called, and there is no other error showing in console.log.
Actually I am working on AngularJS for the first time. I could not realize that I need to inject state urls to app.js. After adding it, the $state.go has started to redirect to url.

How to achieve system page state cache (when I redirect to another page and return to this page again, all data is reserved)

In Angularjs, it will refresh the page each time I come into a new page.
Now in Page1, I have already opened a modal dialog and written some texts in it, then I click a button it redirect to Page2.
There's a link now in the header like : Page1 -> Page2.
When I click Page1 of the link, it will return to Page1 with all former data kept(modal is opening, data is still there...)
How to accomplish system page state cache in angularJS?
You need to store the page state somewhere. Most sites are using SessionStorage or LocalStorage.
Everytime you change your page state you have to update your storage.
On a page reload you need to check your storage whether there is any state saved and load it before any other interaction.
The easyiest way may be a angular plugin like https://github.com/gsklee/ngStorage or https://github.com/grevory/angular-local-storage

Redirect to welcome page on pressing back button in react Single page application

I have a react single page application, so on pressing back button, its redirecting me to welcome page as expected. Now due to some requirement, I have to update the URL of the app in between and due to which if now I press back button, its first redirect me to old url page and then welcome page.
How can I control this behavior, means even after updating the URL, user should directly redirected to welcome page on pressing back button.
I think you can make use of react-router-dom here. There is Link element available in react-router-dom which can solve your problem.
For eg:, you can try something like this
<Link to="/welcomePage" >Back</Link>
For more information, go through below document react-router-dom document
I don't know how to do it using react router, but you can use window.history.pushState() to solve your problem. In your third component add the following code into the render() method.
window.history.pushState(null, null, '/your-welcome-page-url');
It will change the current url to welcome page url without reloading the page; and when you will press the browser back button, the browser will be redirected to welcome page.

Redirecting to previous page without reloading

I have a question that suppose, I have an Admin Dashboard page, on which I have given a list of users. clicking upon a particular user the details of corresponding user is shown on a different page (say on userDetails.jsp). Now I have a back button on userDetails page, Clicking of which I need to redirect admin to the last visited page that is Admin Dashboard page, I have one solution that I can "Reload" the previos page on clicking back button, but then I feel that there is the overhead of calling a server side API, retrieving all the data, Again redraw the whole admin dashboard page even when there is no change made in the userDetails[because it is read only page, modification is not allowed there]. Is there anyway that I can make user of cache or anything else so that I will not need to go to the server to fetch all the data again. I am using spring MVC, angularjs, Thank you.
On your button's click event add the following code:
$window.history.back();
make sure to use $window rather than window since you're using AngularJS

Resources