MyFaces Core
  1. MyFaces Core
  2. MYFACES-2373

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

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.8
    • Component/s: build process
    • Labels:
      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

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development