0 Replies Latest reply on Jul 16, 2008 10:19 AM by paguaro

    SuggestionBox set multiple values

    paguaro

      Hi to all

      I have a problem with suggestionbox.

      On my page, I need to collect from a suggestion box the value and the
      id, but the tag can copy only one value.

      I tried to resolve the problem using a a4j:jsfunction, I wrote the
      value+id in the fetchValue attribute and rerender the input box field.

      I can see this effect:

      value + id
      after few second (split the 2 value using java bean)
      value

      The only solution is javascript? or is possibile to use only jsf/java code

      I use the suggestion-sample from source tar.

      thanks

      daniele

      p.s. sorry for my english

      ----------------------
      my sample code

      <h:inputText value="#{suggestionBox.property}" id="text"/>
      <a4j:jsFunction name="updatePrice" reRender="text">
      <a4j:actionparam name="param1" assignTo="#{suggestionBox.myPrice}"
      />
      </a4j:jsFunction>

      <rich:suggestionbox id="suggestionBoxId" for="text" tokens=","

      rules="#{suggestionBox.rules}"

      suggestionAction="#{suggestionBox.autocomplete}" var="result"
      fetchValue="#{result.text}|#{result.label}"
      first="#{suggestionBox.intFirst}"
      minChars="0"
      shadowOpacity="#{suggestionBox.shadowOpacity}"
      border="#{suggestionBox.border}"
      width="#{suggestionBox.width}"
      height="#{suggestionBox.height}"
      shadowDepth="#{suggestionBox.shadowDepth}"
      cellpadding="#{suggestionBox.cellpadding}"
      onselect="updatePrice(this);"

      usingSuggestObjects="#{suggestionBox.usingSuggestObjects}">
      <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
      <h:column>
      <h:outputText value="#{result.text}"/>
      </h:column>
      <h:column>
      <h:outputText value="#{result.price}">
      <f:convertNumber pattern="#,##.00" type="currency"/>
      </h:outputText>
      </h:column>
      </rich:suggestionbox>