Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
With trinidad-faces-plugin it is possible to add event documentation for components. For example, h:commandButton component could handle ActionEvent, h:inputText component handle ValueChangeEvent. In the generated tlddoc, it renders a table like this:
Type Phases Description
javax.faces.event.ActionEvent Invoke Application
Apply Request Values Event delivered when the "action" of the component has
been invoked; for example, by clicking on a button.
The action may result in page navigation.
One option is add a @JSFEvent annotation, but it seems better add a @JSFListener annotation and use it like this (for example in UICommand):
/**
- The event handled by this Listener is delivered when the "action" of the component has
- been invoked; for example, by clicking on a button.
- The action may result in page navigation.
**/
@JSFListener(event="javax.faces.event.ActionEvent",
phases="Invoke Application, Apply Request Values")
public ActionListener[] getActionListeners() { return (ActionListener[]) getFacesListeners(ActionListener.class); }
Note this annotation has only documentation purposes, so it does not trigger side effects on code templates.
Suggestions are welcome