function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Question: Can I refresh to top of VF page on submit() without using javascript?

I'm a newbie at this, but thought I'd better find out if I could do this in native VF before I start fiddling with javascript.


I've created a VF survey that runs inside a Drupal i-frame.  Some of the survey pages are long, and require scrolling to the bottom.  When users click "Next Page," they end up seeing a lot of blank space at the bottom of the iframe, and have to figure out that they should scroll back to the top to the beginning of the next page.  As you VF programmers probably know, not all users figure this out, and the multiple scroll bars confuse them.


We've tried javascript for window resizing.  The problem with javascript so far is that it conflicts with the jquery SF uses for things like lookup buttons and multi-picklists, so putting the page resizing javascript on pages with those features breaks the SF functionality.


Is there a simple VF way to the "Next Page" button to go to the top of the i-frame?





If you want to control when your array gets refreshed wrap it in an outputpanel and put its id in the rerender attribute of whatever causes the data to need an update. I had to use this previously to reattach some custom jQuery input listeners when every the dom was re-updated.

<apex:repeat value="{!objects}"var="object">

Thanks Ramana.  Will this work if the VF and the Drupal website reside on different servers?