Linking to the same page keeping the same screen position

Linking to the same page keeping the same screen position

  
Hi,

I'm using a webpage with a hidden button, that is executed by the onchange propriety whenever a field is changed, linking to the current page with different inputs, in order to refresh the selection options to another field in the same page.

When the page is refreshed, the page returns to the top of the screen.

How could I refresh the same page keeping the same screen position?

Best Regards,
Gonçalo
Hi Gonçalo,

Here's a way. Add this non-escaped expression to the position where you want to scroll to:

"<a name='MyAnchor'>"

Then add this non-escaped expression to the end of the screen:

if (Id = nullidentifier(), "", "
<script language='javascript' type='text/javascript' defer>
try {
document.location = '#MyAnchor';
}
catch (e) {} </script>
")

Don't forget to customize the IF condition. You may also define various anchors, depending of some logic - just replace MyAnchor for the one you wish to activate.

You should also check these topics, for alternative solutions:
http://www.outsystems.com/NetworkForums/viewtopic.aspx?TopicId=3167
http://www.outsystems.com/NetworkForums/viewtopic.aspx?TopicId=3143

Cheers,
Paulo Ramos