7 Replies Latest reply on Nov 1, 2009 9:29 AM by Matt Choate

    Suggestionbox Scroll

    Matt Choate Newbie

      Hello,

      We are using RF 3.3.2 and have a suggestionbox that is in a scrollable div. If we are scrolling the div and enter text into the text box that causes the suggestion box to appear the div scrolls to the top and the suggestion box gets located in the incorrect location. I saw posts in the forum mention this as an old bug. Is this reintroduced in 3.3.2? is there a workaround?

      -matt

        • 1. Re: Suggestionbox Scroll
          Matt Choate Newbie

          Oh and this happens in Firefox 3.5.3 but it works as expected in IE8.

          • 2. Re: Suggestionbox Scroll
            Nick Belaevski Master

            Hi Matt,

            I've observed similar behavior updating contents of inline elements containing block elements. Can you please check if that's your case? NB: a4j:outputPanel is "inline" by default.

            • 3. Re: Suggestionbox Scroll
              Matt Choate Newbie

              Well we have the suggestion box inside an h:panelGrid that is contained inside a rich:panel. Does that give you any ideas?

              • 4. Re: Suggestionbox Scroll
                Nick Belaevski Master

                I cannot reproduce the issue:

                <div style="overflow: auto; height: 200px;">
                 <rich:panel>
                 <h:panelGrid columns="1">
                 <div style="height: 300px; border: 1px solid navy;"></div>
                 <rich:suggestionbox id="suggestionBoxId" minChars="3" for="inputID"
                 tokens=",[]" usingSuggestObjects="true"
                 suggestionAction="#{forum5Bean.suggest}"
                 var="result"
                 width="150" height="150">
                 <h:column>
                 <h:outputText value="#{result}" />
                 </h:column>
                
                 <a4j:support event="onselect">
                 <f:setPropertyActionListener value="#{result}" target="#{forum5Bean.o1}" />
                 </a4j:support>
                
                 </rich:suggestionbox>
                 <h:inputText id="inputID" value="a">
                 </h:inputText>
                 </h:panelGrid>
                 </rich:panel>
                </div>


                • 5. Re: Suggestionbox Scroll
                  Matt Choate Newbie

                  One difference we have is that the rich:panel has a style class which sets the overflow:auto CSS property. Your example has the scrollable div outside of the panel.

                  • 6. Re: Suggestionbox Scroll
                    Nick Belaevski Master

                    rich:panel is a DIV also, so this doesn't change anything and I cannot reproduce the problem.

                    • 7. Re: Suggestionbox Scroll
                      Matt Choate Newbie

                      Thanks for all the help Nick. I found out what was causing the problem. You had mentioned it earlier but I did not connect the dots until now. I have two forms on my JSP page. The first form contained my suggestion box and other form data. The second contained this code:

                      <a4j:outputPanel ajaxRendered="true">
                       <h:form prependId="false">
                       <h:inputHidden id="maximumSeverity" value="#{facesContext.maximumSeverity != null ? facesContext.maximumSeverity.ordinal : 0}" />
                       </h:form>
                      </a4j:outputPanel>
                      


                      Which I was using to determine if there was a validation error. If I take out the ajaxRendered=true then I don't get the scrolling issue with the div. Is there a better way to determine via client script if there was a validation error?

                      -matt