title: PF Autocomplete completemethod is not being triggered
body: <p>I'm working on a project using JSF 2 &amp; Primefaces 5 where navigation is done entirely by ajax. When getting into a page with a basic autocomplete component, the complete method is not being triggered. When refreshing the page, then the complete method is working. Sample of the autocomplete:</p>
  
  <pre><code>&lt;label for="name"&gt;Your name &lt;em&gt;*&lt;/em&gt;&lt;/label&gt; &lt;br/&gt;
  &lt;p:autoComplete id="name" value="#{myBean.name}"
       completeMethod="#{myBean.complete}" required="true"
       requiredMessage="Please enter a name"
       placeholder="enter something..." /&gt;
  </code></pre>
  
  <p>Backing bean method:</p>
  
  <pre><code>public List&lt;String&gt; complete(String query){
      List&lt;String&gt; result = new ArrayList&lt;&gt;();
      for(nameData name: this.namesData){
          if(name.toLowerCase().startsWith(query.toLowerCase())){
              result.add(name);
          }
          if(result.size() == 5){
              break;
          }
      }
      return result;
  }
  </code></pre>
  
  <p>Have been searching for this and found possible solutions, tryed implementing them but didn't fix this problem. Seems weird since the posts on this problem were dated from a older version of PF (3.X). FYI;</p>
  
  <p>adding this script...</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          PrimeFaces.escapeRegExpOld = PrimeFaces.escapeRegExp;
          PrimeFaces.escapeRegExp = function(c) {
              var t = PrimeFaces.escapeRegExpOld(c);
              t = t.replace('&amp;amp;', '&amp;amp;amp;');
              return t;
          };
   &lt;/script&gt;
  </code></pre>
  
  <p>Adding this function and calling it when autocomplete gets focus</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
              function escapeTerm(request) {
                  request.term = encodeURIComponent(request.term);
              }
   &lt;/script&gt;
  </code></pre>
  
  <p>Thanks for your time!</p>