1 Reply Latest reply on Aug 18, 2009 9:04 AM by Ilya Shaikovsky

    How to get more info from a suggestionbox

    Kto ToTaki Newbie

      suggestionbox working with inputText could be like this :

      <h:inputText value="#{bean.node}" id="nodeId" />
      <rich:suggestionbox ajaxSingle="true" border="1" for="nodeId" width="311"
      suggestionAction="#{bean.findNodes}" var="node" >
       <h:outputText value="#{node.name}"/>

      returns nodes objects with attrib. <id, name>

      suggestionbox shows node.name, inputText should show chosen node.name too, but bean needs node.id value.
      node.name is not unique, so there is no way to find node.id based on node.name

      We could use fetchValue="#{node}", with converter on inputText, but as I said there is no possible to get node.id based only on name.

      How to get node.id into the bean ?