I need a little help with app. I have a search bar where people can search restaurants near them.
My issue is that once the list of nearby restaurants appear and the user clicks on one of them to view more and press back to go back to the list so he/she can select another restaurant from the list, the data disappear. The user has to perform a new search.
How do I fix that? At least allow the users to go back and forth between the list and a specific restaurant!
Would it work if within a table (I would use the User table) have a field I would call “Last Search”. In here save the value the user has last selected when they navigate to a new page. Then set the default value of the search to this “Last Search” in the table.
The common approach is to use a URL parameter to set and “preserve” your search. So, when a user selects an option, you update a parameter in the URL. Related to this, you set the constraints of your search / data source based on the parameters in the URL.
Try performing a search on Yelp and pay close attention to what happens to the URL as you look through search results and navigate to a specific business page.