0 Replies Latest reply on Oct 1, 2007 12:42 PM by Jaime Martin

    suggestion box data conversion problem

    Jaime Martin Apprentice

      I´m using suggestion box component. The values are fetched and showed properly in the suggestion box.
      My problem is that after selecting one value, I have the following error:
      value could not be converted to the expected type
      This error matches the tag javax.faces.component.UIInput.CONVERSION so I´ve a conversion problem.
      The code of the web page is this:

      <s:decorate id="currencyIsoDecoration" template="layout/edit.xhtml">
       <ui:define name="label">#{messages['CfgCurrency']}</ui:define>
       <h:inputText id="currencyIso"
       <a:support event="onblur" reRender="currencyIsoDecoration"/>
       <rich:suggestionbox for="currencyIso" suggestionAction="#{suggestionBox.autocomplete}"
       var="result" fetchValue="#{result}" >
       <h:outputText value="#{result}" />

      And the autocomplete is this: (currencyList query returns a list of Strings)

       public class SuggestionBox implements Serializable {
       public List autocomplete(Object suggest) {
       currencyIso = suggest.toString();
       ArrayList result = new ArrayList();
       Iterator<CfgCurrency> currencyIter = currencyList.iterator();
       CfgCurrency ccy = null;
       while ((currencyIter != null) && (currencyIter.hasNext()) ) {
       ccy = currencyIter.next();
       return result;

      CfgCurrency class has been generated by means of seam-gen as well as rstReportHome. This is the code:

      public class RstReportHome extends EntityHome<RstReport> {
       @In(create = true)
       CfgCurrencyHome cfgCurrencyHome;
      @Table(name = "CFG_CURRENCY", catalog = "prisk", uniqueConstraints = @UniqueConstraint(columnNames = "currency_iso"))
      public class CfgCurrency implements java.io.Serializable {
       private String currencyIso;

      In the input text I want to assign the value to a String attribute #{rstReportHome.instance.cfgCurrency.currencyIso}, and the values fetched
      with the suggestion box are strings. I don´t understand why there is a conversion problem.
      I will be appreciated your suggestions.
      thanks in advance!