Reputation: 2888
I am working on a JSF 2.0 project, and learning the benefits of using System Events. However, the book I'm referencing 'Core Java Server Faces 3rd Edition' lists a total of 14 system event types that can be used in the f:event tag's type attribute. Some of them work as I would expect, e.g. "preRenderComponent" on a UIComponent tag, or "preRenderView" on a UIViewRoot tag. But, besides those two, and a select few others, none of the other events mentioned in the book work. For example, I can't get the postRestoreState type of event to work on a UIComponent. Instead, when JSF tries to render the page, I get a ClassNotFound Exception, presumably to the System Event class that is supposed to handle postRestoreState events, or whatever event it is I'm trying to listen for.
Why don't these other event types work? Is there some other library I need, or is there some other way of implementing a system event listener that I need to use. Below is an example of one such tag that is failing:
<h:commandLink
action="editPlant"
value="#{appMessages.UsersNavigationAddPlant}"
styleClass="#{userSession.selectedStyle}"
>
<f:event type="postRestoreState" listener="#{userSession.setSelectedStyle()}" />
</h:commandLink>
Upvotes: 0
Views: 657
Reputation: 8412
It appears that you need the full Class name:
<f:event type="javax.faces.event.PostRestoreStateEvent" listener="#{bean.postRestoreState}"/>
Upvotes: 1