How to send user to the top of the screen after an action?

Hi, I'm new in outsystems and can't solve this problem for a while...


I have a screen action (Ajax Submit) that in the end, changes a variable value that will result in changing the content (container) displayed in the screen. The problem is that the button is in the end of the first container. The result is that when the next container is displayed, I'm also in the end of it, insted of being in the top, like if it was a new web screen.


I've found some solutions in this forum, but none of them worked for a button that has another action happening. 

First Content= Click on Button Next


Second Content = Redirected to the end of the content

I was able to accomplish this by adding the following to the extended properties to a container at the top of my page.

osTagName    with a value of 

SyntaxEditor Code Snippet

"A name='nameOfYourChoosing'"


Then in your screen action add a RunJavascript action with the script below.

SyntaxEditor Code Snippet

"window.location.hash='nameOfYourChoosing';"


Solution

Hi Tarek,

you can add another button on the screen that scrolls to the top  (navigate to "#") :


make sure this button is hidden, for example in the preparation ;

and at the end of your existing ajax submit screen action, use a widget_click on this button after the ajax refresh



Is this what you are after ?

Dorine


Edit : you can add Widget_Click and Widget_Hide as dependencies from the RichWidgets producer 

Solution

Thank you very much Josh and Dorine,


Both of your suggestions worked.


 I just had to make an ajustment in your action Dorine... I used the widget_click before the ajax refresh, in the beggining of the action.


Best regards,


Tarek