2 Replies Latest reply on Dec 6, 2007 3:26 AM by koenhandekyn

    Presenting a No Results Message with an Empty Collection on

      I am attempting to use RichFaces and Seam to do something quite common. I have a search page where I want to present the results of the search on the same page as the search form itself. When the user first comes to the page, there is nothing but the form of course. When the user hits the button, if there are results, you get a scrollable table beneath the form. Otherwise, you get a message in that location informing you that the search returned no results.

      The trick is that we are coming back to the same page. I am aware of the "rendered" attribute for conditionally rendering components, but I also need to be aware of whether this is the first access of the page or not. In ASP .Net, you check this with an isPostBack() method call in the code-behind. What is the best way to accomplish that here? Simply set a managed bean property when the user submits for the first time? That just seems so inelegant and unnecessary.

      My question is simply if there is a "best practice" for accomplishing this. Perhaps with FacesMessages. Or if there is an outside-the-box way for accomplishing the same concept that's more consistent with the JSF and/or Seam/RichFaces paradigm.

      Thanks.