title: PrimeFaces p:autoComplete over List of Objects, failed Conversion
body: <p>I'm having some trouble using <code>p:autoComplete</code> properly, I am trying to let a user search based on a text field of an object. Currently I have the following:</p>
  <pre><code>&lt;p:autoComplete forceSelection=&quot;true&quot; value=&quot;#{answer.destinationQuestion}&quot;
                  completeMethod=&quot;#{editorView.completeText}&quot;
                  var=&quot;destinationQuestion&quot; itemLabel=&quot;#{destinationQuestion.questionText}&quot;
                  itemValue=&quot;#{destinationQuestion}&quot;/&gt;
  </code></pre>
  <pre><code>public List&lt;Question&gt; completeText(String query) {
          List&lt;Question&gt; ret = new ArrayList&lt;Question&gt;();
          
          for(Section section : this.survey.getSections()) {
              for(Question question : section.getQuestion()) {
                  if(question.getQuestionText() != null &amp;&amp; question.getQuestionText().contains(query)) {
                      ret.add(question);
                  }
              }
          }
          
          return ret;
      }
  </code></pre>
  <p>My expectation with this code is that the autoComplete would let a user select a single <code>Question</code> instance, but once a value is selected from the autoComplete and an update event is triggered, I receive the following exception:</p>
  <pre><code>java.lang.IllegalArgumentException: Cannot convert Question@228bb9f7 of type class java.lang.String to class Question
  </code></pre>
  <p>It has been suggested that I use a converter, but I am confused why the value selected is being treated as a String rather than my Question object, since itemValue is defined to be a Question object.</p>
  <p>Edit: This is on PrimeFaces 6.2</p>