Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2373

Add a way to document event capabilities for components using myfaces builder plugin

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.2.8
    • build process
    • 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

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: