title: Add onkeyup event on datatable filter
body: <p>I would like to add javascript event on this code:</p>
  
  <pre><code>&lt;p:dataTable id="tblQueues" var="q" value="#{gateBacking.listQueue}" filteredValue="#{gateBacking.filteredQueues}" rowKey="#{q.queid}"  
       selection="#{gateBacking.selectedQueue}" selectionMode="single" widgetVar="varQueues"
       scrollable="true" scrollHeight="250"&gt;  
      ...
      &lt;p:column headerText="License No" filterBy="#{q.fleet.licenseNo}" filterMatchMode="contains" &gt;
          #{q.fleet.licenseNo}
      &lt;/p:column&gt;
      ...
  &lt;/p:dataTable&gt; 
  </code></pre>
  
  <p>How can I add <code>onkeyup</code> on the filter? I have tried like this:</p>
  
  <pre><code>&lt;p:column headerText="License No" filterBy="#{q.fleet.licenseNo}" filterMatchMode="contains" onkeyup="formatLicense(this)"&gt;
  </code></pre>
  
  <p>but it doesn't work. How can I do that? Thanks.</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have tried this but it doesn't work:</p>
  
  <pre><code>&lt;p:column headerText="License No" filterBy="#{q.fleet.licenseNo}" filterMatchMode="contains" filterEvent="formatLicense(this)"&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>UPDATE 2</strong></p>
  
  <pre><code>&lt;p:tabView id="tabViewGate"&gt;
      &lt;p:tab id="tabCheckOut" title="Out"&gt;
          &lt;h:form id="frmOut"&gt;
              &lt;p:dataTable id="tblQueues" var="q" value="#{gateBacking.listQueue}" filteredValue="#{gateBacking.filteredQueues}" rowKey="#{q.queid}"  
                  selection="#{gateBacking.selectedQueue}" selectionMode="single" widgetVar="varQueues"
                  scrollable="true" scrollHeight="250"&gt;  
                  ...
                  &lt;p:column id="colLicnu" headerText="License No" filterBy="#{q.fleet.licenseNo}" filterMatchMode="contains" &gt;
                      #{q.fleet.licenseNo}
                  &lt;/p:column&gt;
                  ...
              &lt;/p:dataTable&gt; 
  
              &lt;script type="text/javascript"&gt;
                  $(document).ready(function(){
                      $("#frmOut\\:tblQueues\\:colLicnu\\:filter").keyup(function(){
                          //alert("Test"); //--&gt; I tried this too but it doesn't work
                          if (input.value.length &gt; 1)
                          {
                              var num = '1234567890';
                              var str = input.value[input.value.length-1];
                              var str2 = input.value[input.value.length-2];
  
                              if (num.indexOf(str) &gt;= 0) {
                                  if (!(num.indexOf(str2) &gt;= 0)) 
                                      input.value = input.value.substring(0, input.value.length - 1) + " " + str;
                              }
                              else if (!(num.indexOf(str) &gt;= 0)) {
                                  if (num.indexOf(str2) &gt;= 0)
                                      input.value = input.value.substring(0, input.value.length - 1) + " " + str;
                              }
                          }
                          input.value = input.value.replace("  "," ").toUpperCase();
                      });
                  });
              &lt;/script&gt;
  
          &lt;/h:form&gt;
      &lt;/p:tab&gt;
  &lt;/p:tab&gt;
  </code></pre>