title: Trigger <cc:clientBehavior> event from <p:ajax> nested in composite
body: <p>Is there any way to trigger an event in my composite component with clientBehavior and jQuery?</p>
  
  <p>If not possible, what is the proper way to create custom events in composites?</p>
  
  <p>Example:</p>
  
  <p>ajaxTest.xhtml:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:cc="http://xmlns.jcp.org/jsf/composite"
        xmlns:p="http://primefaces.org/ui"&gt;
  
      &lt;cc:interface&gt;
          &lt;cc:clientBehavior name="myEvent" targets="myLabel" event="myEvent"/&gt;
      &lt;/cc:interface&gt;
  
      &lt;cc:implementation&gt;
          &lt;div id="#{cc.clientId}"&gt;
              &lt;p:outputLabel id="myLabel" value="Test label" /&gt;
              &lt;p:commandLink value="trigger event"
                             onstart="$(PrimeFaces.escapeClientId('#{cc.clientId}:myLabel')).trigger('myEvent');"/&gt;            
          &lt;/div&gt;
      &lt;/cc:implementation&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>testPage.xhtml:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:p="http://primefaces.org/ui"
          xmlns:demo="http://xmlns.jcp.org/jsf/composite/component"&gt;
  
  &lt;h:body&gt;
          &lt;h:form id="form-1"&gt;
              &lt;demo:ajaxTest&gt;
                  &lt;p:ajax event="myEvent" oncomplete="alert('Ajax called');" /&gt;
              &lt;/demo:ajaxTest&gt;
          &lt;/h:form&gt;
  &lt;/h:body&gt;
  &lt;/html&gt;
  </code></pre>