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

    rich:suggestion box response

    a_ananta

      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>

        • 1. Re: rich:suggestion box response
          nbelaevski

          Hi,

          I've created an issue for that: https://jira.jboss.org/jira/browse/RF-5006

          • 2. Re: rich:suggestion box response
            a_ananta

            I checked the comments on this issue, is there any way to restrict this?

            I was thinking of using requestDelay option on command compnenet.

            • 3. Re: rich:suggestion box response
              ilya_shaikovsky

              "restriction of requests which reRenders the area of suggestion, or more accurate reRender" from the comment.

              So do not update all the area. reRender only the components which really need to be updated. If you updates the area with suggestion these glitches will be appears for sure. And I do not think that this is a bug. Because you call the suggestion and then replace the component which should be its parent in DOM.

              • 4. Re: rich:suggestion box response

                I am also having the same issue in our application. In my case the suggestionbox textbox is inside a panel and the panel is closed when reRenders. If I start typing in the suggestionbox textbox, when already a request is in progress, the page when reRenders from the first response has the suggestionBox in the (0,0) position because its parent text box is now inside a closed panel. And this happens only in Firefox.

                If the parent is not rendered in the DOM, the suggestionbox component also should not be rendered. Why would the component render itself if the parent element is not displayed.