The <f:event type="preRenderView">
is in this construct in essence a hack/workaround. It's as its name says indeed always invoked before render response phase regardless of the type request (postback or not) and the validation result (fail or not). This is also in detail elaborated in this related question: What can <f:metadata>, <f:viewParam> and <f:viewAction> be used for? This contains the following snippet which should help you further:
public void init() {
FacesContext facesContext = FacesContext.getCurrentInstance();
if (!facesContext.isPostback() && !facesContext.isValidationFailed()) {
// ...
}
}
Put the desired logic there in place of // ...
.
In JSF 2.2, a standard solution is available in flavor of <f:viewAction>
, also demonstrated in the aforementioned related question.