Add a way to document event capabilities for components using myfaces builder
plugin
------------------------------------------------------------------------------------
Key: MYFACES-2373
URL: https://issues.apache.org/jira/browse/MYFACES-2373
Project: MyFaces Core
Issue Type: Improvement
Components: build process
Reporter: Leonardo Uribe
Priority: Minor
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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.