13 Replies Latest reply on Nov 3, 2009 5:46 AM by Fabio Affinito

    suggestionbox and valuechangelistener

    Fabio Affinito Newbie

      Hi,
      i'm having serious difficulties in implement a valuechangelistener inside a suggestionbox machinery.
      I'll try to explain:
      I have a suggestionbox where the user is supposed to entry the residence city by choosing the first characters. For example, inserting Rom, the user would get Rome, click on it and going on.
      I would like to intercept this choice, so I wrote this code in my page.xml:

      <s:decorate id="domCityField" template="layout/edit.xhtml">
       <ui:define name="label">Comune</ui:define>
       <a:region renderRegionOnly="true">
       <h:inputText id="domCity"
       required="true"
       valueChangeListener="#personaction.chosedomCity}"
       onchange="submit()" reRender="person"
       size="38"
       maxlength="50"
       value="#{personHome.instance.domCity}"
       converter="cityConverter" />
       <rich:suggestionbox height="200"
       width="600"
       selfRendered="true"
       for="domCity"
       suggestionAction="#{cityList.suggest}"
       var="_city"
       fetchValue="#{_city.name}">
       <h:column>
       <h:outputText value="#{_city.name} (#{_city.province.name})" />
       </h:column>
       </rich:suggestionbox>
       </a:region>
       </s:decorate>
      


      The problem now is that when I enter "Rom", I get the suggestion "Rome", I click on it, then something seems to happen (the browser send some request to the server apparently), but the value on the field returns to be "rom" instead of "Rome" (and the intercepted value is "rom", not "Rome").
      What did I wrong?

      Thank you for helping,

      Fabio