1 Reply Latest reply on Apr 22, 2010 9:21 AM by Ilya Shaikovsky

    rerendering a4j:mediaoutput resets scroll position

    Johann Igzorn Newbie

      Hi there!

       

      I have an a4j:mediaoutput image on my jsf like this:

       

      <a4j:mediaOutput id="mediaoutput" element="img" onclick="getCoordinates(event)" cacheable="false" session="true" createContent="#{Graphbean.createGraphPaint}" value="#{Graphbean.counter}" mimeType="image/jpeg" />

       

      then I have a component that rerenders the mediaoutput:

       

      <a4j:form>
              <a4j:commandButton value="Refresh" action="#{Graphbean.createGraphAction}" reRender="mediaoutput, params, selectJob" />
      </a4j:form>

       

      the image is reloaded but since it's a very big one, I'd like to hold the position where I scrolled to. But that isn't the case, the site jumps to the top. If I leave 'mediaoutput' out of the reRender attribute of the button, the position stays the same.

      Any ideas how to accomplish this?