1 Reply Latest reply on Feb 21, 2011 5:27 AM by ilya_shaikovsky

    autocomplete behavior clarification sought - 4.0.0.M6

    healeyb

      I read this post (http://community.jboss.org/message/585236#585236) regarding autocomplete

      which seemed to suggest that if the autocompleteMethod is returning a List<MyClass> then you

      can't store an instance of MyClass in the value=.  Is that a correct interpretation?

       

      Do you have to take the selected text and one way or another convert it to an object instance?

      The showcase deals with a rather simplistic case and wasn't any assistance to me on this

      particular matter.

       

      I tried all kinds of various combinations of converter, itemConverter, fetchValue etc...  with no

      success. I also tried using rich:select but given the inability to delay the server lookup until some

      characters are typed in I was getting back 5000 rows, and the performance wasn't good even on

      a localhost server (this is test data from a production system).

       

      {code:xml}

      <rich:autocomplete id="club"

      var="var"

      minChars="3"

      mode="cachedAjax"

      fetchValue="#{var.name}"

      converter="MyClassConverter"

      layout="list"

      value="#{myBean.}"

      autocompleteMethod="#{myBean.nameSearch}">

      <h:outputText value="#{var.name}"/>

      </rich:autocomplete>

      {code}

       

      So, I'd be grateful if anyone can shed any light on this, i.e. is this a present limitation? if so is

      it planned to be addressed at some point?

       

      Thanks,

      Brendan.

        • 1. autocomplete behavior clarification sought - 4.0.0.M6
          ilya_shaikovsky

          autocomplete is a UIInput. So you have to use converter and convert just text which was entered/suggested to some objec. It will not provide old object selection as it's non-native for input.

           

          select should be used but for now it has no ajax mode implemented. When it will become available - it will become an official solution.