myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Werner Punz <>
Subject Re: [jsf 2.0] PreValidateEvent and PostValidateEvent should be called from UIInput.processDecodes() and UIInput.processValidators(), but there is no mention on javadoc
Date Fri, 25 Sep 2009 09:38:12 GMT
Leonardo Uribe schrieb:
> Hi
> Checking the spec section, it says this:
> /"...EditableValueHolder is a source of ValueChangeEvent, 
> PreValidateEvent and PostValidate events. These are emitted during calls 
> to validate(), which happens during the Process Validations phase of the 
> request processing lifecycle. The PreValidateEvent is published 
> immediately before the component gets validated. PostValidate is 
> published after validation has occurred, regardless if the validation 
> was successful or not. If the validation for the component did pass 
> successfully, and the previous value of this component differs from the 
> current value, the ValueChangeEvent is published...."/
> If the text is taken literally, we should call them inside validate() 
> method (myfaces is doing this right now), but the common sense says we 
> should publish this events from outside ( UIInput.processDecodes() and 
> UIInput.processValidators() ) because if we override validate() method, 
> the event publishing just get lost.
> The javadoc should mention on UIInput.processDecodes(), 
> UIInput.processValidators() or UIInput.validate() that those listeners 
> should be called from there.
Id say lets do it in a sane way,not sure if the validate really is a 
good place because what happens if someone overwrites the validate
and calls super.validate, then the events would be dispatched in the 
middle of the validation.
If it goes through the TCK Then it is ok if not then we have to change 
it back. Better sane then "dirty" I´d say.

Btw. I dont think the entire thing is contradictory unless the javadocs 
forbid it, do we have to publish the ValueChanged event inside of validate?
Otherwise I would move that out as well, to keep the dispatching order!
So it ends up to publish both events first the endValidate and secondly 
the value changed from outside of EditableValueHolder.


View raw message