This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes JSF: Check for PostBack. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSF: Check for PostBack." Watch "JSF: Check for PostBack." New topic

JSF: Check for PostBack.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

I have a form with several selectOneMenu's that are populated from a Database. On this form I have one menu option that only changes whether or not a specific panel is hidden or visible. Because this has to submit back to the server, I realized that every time I change this option, all my selectOneMenu's are going to hit the database again to get their values. This is not good.

In .NET (don't smite me) there is a check that is basically something like if(!Page.IsPostBack) and what that does is checks to see if the page was submitted back to itself and if not, it will enter that loop.

I need something similar in JSF so that if the page is posted back, I don't need to get all those values from the database again. It should just use what values the backing bean already has.

Any ideas?

GenRocket - Experts at Building Test Data
It is sorta covered in the JavaRanch Style Guide.
subject: JSF: Check for PostBack.
Similar Threads
JSF limitations
Extending A4J 1.1.0 AjaxFormRenderer to write token on a4j:form tag
Edit form data with radio buttons
Collections of Objects within an ActionForm
remitting values