title: Primefaces selectOneMenu ajax event on select / click
body: <p>I am using Primefaces 5.0. I have a selectOneMenu with ajax listener inside:</p>
  
  <pre><code>&lt;p:selectOneMenu value="#{mybean.myselection}" &gt;
      &lt;f:selectItems value="#{mybean.mylist}" /&gt;
      &lt;p:ajax listener="#{mybean.test}" /&gt;
  &lt;/p:selectOneMenu&gt;
  </code></pre>
  
  <p>The listener is called every time when value is changed. This works fine. But I also need an event like "select" or "click" which fires an action also when the selecteditem is clicked.</p>
  
  <p>I could not find an event in PF UserGuide. Is there an easy way to do this?</p>
  
  <p>EDIT:
  Add Javascript functioN.</p>
  
  <pre><code>   &lt;h:form&gt;
      &lt;p:selectOneMenu value="#{mybean.myselection}" widgetVar="mySelect"&gt;
          &lt;f:selectItems value="#{mybean.mylist}" /&gt;
          &lt;p:ajax listener="#{mybean.test}" /&gt;
      &lt;/p:selectOneMenu&gt;
     &lt;h:form&gt;
  
  &lt;script&gt;
              //&lt;![CDATA[
              $(document)
                      .ready(
                              function() {
                                  PF('mySelect').selectItem = function(item,
                                          silent) {
                                      var selectedOption = this.options.eq(this
                                              .resolveItemIndex(item)), currentOption = this.options
                                              .filter(':selected'), shouldChange = null;
  
                                      if (this.cfg.editable) {
                                          shouldChange = (selectedOption.text() != this.label
                                                  .val());
                                      } else {
                                          shouldChange = true;
                                      }
  
                                      if (shouldChange) {
                                          this.highlightItem(item);
                                          this.input.val(selectedOption.val())
  
                                          this.triggerChange();
  
                                          if (this.cfg.editable) {
                                              this.customInput = false;
                                          }
                                      }
  
                                      if (!silent) {
                                          this.focusInput.focus();
                                      }
  
                                      if (this.panel.is(':visible')) {
                                          this.hide();
                                      }
                                  }
                              })
              //]]&gt;
          &lt;/script&gt;
  </code></pre>