I have a search field in the header, which is basically a inputText and a button (hidden). I have a backing bean, call it search manager, that can hold the search term (string) and exposes a method to perform the actual search (query DB) using the search term. The inputText binds to the search managers search term field, so that the manager knows what is being searched for.
As of scope, I would like the search manager to be either request or viewscoped because anything higher wouldn’t make sense (from a logical point of view). The problem is that if I navigate from the page that contains the search field, let’s say homepage, to the search result page after someone has entered something into the search field, then the search manager bean will be reconstructed and the search word is lost.
I don’t understand how to handle this case in JSF. I don’t see any option. I see many examples on the internet about search examples, but none of them search from a different page and then navigate to the result page. All of them stay on the same page, which does not produce the errors I am dealing with.