title: JSF: <f:event> with custom events
body: <p>I can't figure out if it is possible to use custom events using f:event. The book by Ed Burns suggests to ad the @NamedEvent annotation to the Event class and to use:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;f:event type="com.foo.bar.myEvent" listener="#{listener} /&gt;
  </code></pre>
  
  <p>but the event seems never to be instantiated. </p>
  
  <p>From my point of view this makes sense, since the component does not know anything about the event, e.g. when to publish, so this might be useful for custom component authors only.</p>
  
  <p>On the other hand, standard components should be able to publish the the event if derived from e.g. PostAddToViewEvent. Anyway, custom events seem to be never published by standard components. </p>
  
  <p>Am I missing something? Is there a convenient way to use custom events with standard components?</p>
  
  <p>Here is what I wanted to do:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:inputText id="input"&gt;
      &lt;f:event type="foo.bar.MyCustomEvent" /&gt; 
  &lt;/h:inputText&gt;
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>public class MyCustomEvent extends javax.faces.event.PostAddToViewEvent {
  }
  </code></pre>