[jsr-314-open-mirror] [jsr-314-open] [2.1 Spec Review] Pre/PostValidateEvent publishing conditions

Andy Schwartz andy.schwartz at oracle.com
Tue Oct 19 17:42:59 EDT 2010


The following text was added to the Pre/PostValdiateEvent API doc:

> When an instance of this event is passed to 
> SystemEventListener.processEvent(javax.faces.event.SystemEvent) or 
> ComponentSystemEventListener.processEvent(javax.faces.event.ComponentSystemEvent), 
> the listener implementation may assume that the source of this event 
> instance is the UIComponent instance that is that has just been validated.
>
> Note that iterating components such as UIData, and form components 
> such as UIForm must publish this event after processing their children 
> nodes in UIComponent.processValidators(javax.faces.context.FacesContext).

Does this mean that only input, UIData and UIForm components will 
deliver these events?

If so, some concerns about this:

1.  Mojarra 2.0 delivered these events for all components.
2.  The Mojarra trunk still does this (see 
UIComponentBase.processValidators()).
3.  This prevents mutti-component validation where a listener is 
registered on an arbitrary ancestor component.

For an example of #3, see the "Multi-Component Validation" section of 
Core JavaServer Faces, 3rd ed:

http://my.safaribooksonline.com/9780137013968/331#X2ludGVybmFsX0ZsYXNoUmVhZGVyP3htbGlkPTk3ODAxMzcwMTM5NjgvMzMx

Note that the PostValidateEvent listener is registered on an 
h:panelGrid.  With the new addition to the specification, it seems that 
this is no longer supported.

Andy




More information about the jsr-314-open-mirror mailing list