This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm new to JSF and I'm having the following issue:
I'm writing a page to add a new user to the database. This is what it is supposed to do: let the user fill in the fields, validate entered values and if no errors (by errors I understand wrong values in fields, i.e. a number in a name field, or missing values when required) were found then it should prompt the user asking him whether he or she actually wants to add this info to the database, if yes: proceed and add user to the DB, otherwise, do nothing. The thing is that no matter whether errors were found or not, it always asks the user if he or she wants to add the user to the database, which it should not do if errors were found.
I'm using the commandButton's attribute onsucess to do this, but I'm not sure if this is the intended use for it. It would be nice if any of you could tell me what I'm doing wrong or what I should do instead to achieve what I want.