5 Replies Latest reply on Nov 26, 2008 12:10 PM by ronanker

    Rerender and Page Scroll

      Hello,

      I have a long page that requires the user to scroll vertically to see a little form at the bottom of the page. There is some dynamic behavior on the form implemented in Richfaces. When the user interacts with some of the widgets I rerender pieces of the form.

      This behavior works just fine except that the rerender triggers the browser to pop back up to the top of the page each time. So the user has to scroll back down to the bottom again. Incredibly annoying user experience.

      Is there any way to avoid this behavior and just rerender things without moving the user from where they are?

      Thanks in advance,
      Greg

      ps. code for my panel is included below

       <a4j:outputPanel id="asnEmails">
       <h:outputText value="[(don't send email notifications)]"
       rendered="#{!cartMgr.cart.receiveASN}" />
       <a4j:outputPanel rendered="#{cartMgr.cart.receiveASN}" >
       <h:outputText value="#{cartMgr.cart.asnEmails[0]}" />
       <br/>
       <a4j:repeat first="1" value="#{cartMgr.cart.asnEmails}" var="email">
       <s:link style="padding-left:3px;" value="#{email}"
       action="#{cartMgr.selectEmail}" reRender="asnEmails">
       <f:param name="emailId" value="#{email.id}" />
       </s:link>
       <br/>
       </a4j:repeat>
       <rich:inplaceInput id="sand" defaultLabel="(add more)"
       viewClass="editable" value="#{cartMgr.cart.emailSandbox}">
       <a4j:support event="onviewactivated"
       action="#{cartMgr.cart.addEmail}" reRender="asnEmails,sand" ajaxSingle="true"/>
       </rich:inplaceInput>
       </a4j:outputPanel>
       </a4j:outputPanel>