1 Reply Latest reply on Dec 31, 2008 6:02 PM by Greg Zoller

    Page pop on reRender?

    Greg Zoller Newbie

      Hello,

      I'm having a strange problem on a long screen (longer than the height of the browser window) where the screen is popping back to the top of the page on reRender.

      Here's some sample code that illustrates the effect.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:s="http://jboss.com/products/seam/taglib">
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <title>Foo</title>
      </head>
      <body>
       <h:form id="fooForm">
       <rich:spacer height="1000px" width="50px" style="background-color:blue"/>
       <br/>
       <a4j:region id="asn">
       <s:link value="One" reRender="asn"/>
       <br/>
       <s:link value="Two" reRender="asn"/>
       <br/>
       <s:link value="Three" reRender="asn"/>
       <br/>
       </a4j:region>
       </h:form>
      </body>
      </html>
      


      When I scroll down and click on one of the links, the page pops back up to the top--not the effect I want. I want the page to stay put and not move. Any ideas how to accomplish this?

      I'm running this in a JSF/facelets environment.

      Thanks for any ideas.

        • 1. Re: Page pop on reRender?
          Greg Zoller Newbie

          Never mind--it's an s:link problem.

          a4j:commandLink renders href="#" in the 'a' element it outputs. This causes the screen to stay put.

          s:link for whatever reason doesn't render this href code so the screen pops up undesirably.

          If there's no good reason not to, it's probably a deficiency in s:link that should be addressed.