Maintaining scroll position

Maintaining scroll position

Hi there!

I would like to know if you have a solution for the following question: how do I maintain the scrolling position on a page after a postback?

I'm using the version 5.0 of Service Studio, and I'm also using the new stylesheet.

I've searched your forums, but all presented solutions (Javascript scripts) are a bit old and seem to regard version 4.2 or previous.
In 5.0, they don't work. It seems that the javascript automatically generated by the platform overrides my code.

All solutions presented by Google work the same way.

Any ideas regarding this matter?

Thanks in advance.

Best regards,
Ricardo Barbudo
Hy there

On the attachment you can find a few ways to set Anchors, the Anchors will aid you on the positioning after a post back or following a link
Hope this helps!

Gonçalo Cardoso
Hello Richard,

I've attached an espace which supplies that functionality. I've got it somewhere from the forum but wasn't able to find it anymore.

I used it, it's simple to apply (I added the block to the footer and it works for all pages :) ) and it works great.

Kind regards,
Since I wasn't able to delete the file, here is the new one

The other oml has IPP-protection on it, this one doesn't.

Kind regards,
Hi guys,

You can also take a look into these 2 other forum topics:
Keeping scroll position after a postback
Something like an Anchor...

Tiago Simões
Hi Ricardo,

There is actually a nice way to do that.

So you can create an extension with an action to do that and use it on the preparation of the screens you want to keep the scroll.

Should be something like
AppInfo.GetAppInfo().OsContext.CurrentScreen.MaintainScrollPositionOnPostBack = true;

No idea if there is an equivalent way to do on Java.
But what this does is just to inject a couple lines of javascript in the output page, so if needed you can just check what if does and replicate.

João Rosado

Thats the post I was looking for :). Thas is also the post where the scolllock widget (only called lockscroll) comes from.

Kind regards,