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

    Page pop on reRender?

    Greg Zoller Newbie


      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"
      <html xmlns="http://www.w3.org/1999/xhtml"
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
       <h:form id="fooForm">
       <rich:spacer height="1000px" width="50px" style="background-color:blue"/>
       <a4j:region id="asn">
       <s:link value="One" reRender="asn"/>
       <s:link value="Two" reRender="asn"/>
       <s:link value="Three" reRender="asn"/>

      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.