When a form submission results in a rerender of a section rather than refreshing the entire Visualforce page, it is very easy to cause error messages from the controller to be swallowed rather than displayed to the user. In this situation, as far as the user is concerned, the form submission is broken; they click on a button and nothing on the page changes.
In this recipe we will create a Visualforce page to create an opportunity. When the account the opportunity is associated with is selected, the form will be submitted and the account record retrieved so that additional fields on the page may populated. If the opportunity name is not defined, the form submission will fail and an error message will be displayed to the user.
This recipe makes use of a controller extension, so this will need to be created before the Visualforce page.