4 Replies Latest reply on Apr 15, 2009 3:50 PM by Indu K

    rich:suggestion box response

    Ananta Amalkar Newbie

      Hi:

      I've an issue while using suggestion box for one field.

      I'm using suggestion box for zipcode field.
      If user enters wrong zip and before the suggestion response comes back, user hit the submit button ( in my code it's "Set"), UI gets disturbed. suggestion box list comes at right top corner of the page.

      This happens because, rerender attribute refreshes the the output panel. I guess because of this refresh, rich component loses it's position on page.

      <h:panelGroup id="userzipcont">
      <a4j:outputPanel id="zipPanel" >

      <s:decorate id="locationdeco" template="/templates/vup.xhtml">
      <ui:define name="label">ZipCode or City, State:</ui:define>
      <h:inputText id="zip" value="#{command.userLocation}"
      required="true" requiredMessage="Please enter zip code" maxlength="25" validatorMessage="Invalid Zip Code">
      <f:validator validatorId="zipVal" />
      </h:inputText>
      </s:decorate>
      <a4j:commandLink limitToList="true" actionListener="#{command.saveZip}"
      reRender="zipPanel"
      >
      Set
      </a4j:commandLink>
      <rich:suggestionbox
      id="suggestionBoxId"
      for="zip"
      suggestionAction="#{command.byCityAndState}"
      var="result" fetchValue="#{result.zipcode}" minChars="3"
      nothingLabel="No Zip found" columnClasses="center"
      ignoreDupResponses="true">
      <h:column>
      <h:outputText value="#{result.city}" />
      <h:outputText value="(#{result.zipcode})" />
      </h:column>
      </rich:suggestionbox>

      </a4j:outputPanel>
      </h:panelGroup>