Can a JSF 2.0 Composite Component emit a custom event?
I have a JSF 2.0 Composite Component which performs a database operation.
Can this Composite Component call a listener method as soon a开发者_如何学Cs this database operation has been performed? (This listener method will be in the backing bean of the page which uses the Composite Component)
You could define a custom event and publish this event form your component. The event should subclass ComponentSystemEvent and needs to be published using UIComponent.publishEvent().
You could register custom event handlers, in this case an implementation of ComponentSystemEventListener, declaratively using f:Event or programmatically using Application.subscibeToEvent() or UIComponent.subscribeToEvent()
精彩评论