cancel
Showing results for 
Search instead for 
Did you mean: 

Scroll to top of page

Former Member
0 Kudos

In a Web Dynpro for ABAP component we have created several views. These are shown as several pages in the application.

The application runs in the portal.

All the views gives a vertical scrollbar, since the iView is set to the height of the longest page. This was done to avoid double scrollbars on the page. When the user press the button to go to the next page (i.e. a new view), the vertical scrollbar is set to the bottom. Sometimes the user sees only a blank screen, and need to scroll to the top to see the content.

We have tried to use code like this

<i> my_runtimeapi TYPE REF TO if_wd_view_controller.</i>

<i>IF first_time = abap_true.

my_runtimeapi = wd_this->wd_get_api( ).

my_runtimeapi->request_focus( attribute = 'MESSAGE' context_element = elem_result_from_sc ).

ENDIF.</i>

in the wddomodifyview method.

This don't solve the problem. It seems that the attribute needs to be a input field. We have UI elements like checkboxes, textsview, messages etc, so the cursor is not moved to the element we try to set focus on.

How can we get the scrollbar to scroll to the top automatically?

Any input on this would be highly appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_szcs
Active Contributor
0 Kudos

Hi Synnøve,

It's not possible to influence the position of the scrollbar from the server as the server is not aware if scrollbars were present or not. Nonetheless, the window should not scroll after a roundtrip, but stay at the previous position. In case that does not happen, I would consider it as a bug. Please open a support ticket to have someone from support/development look at the problem.

Best regards,

Thomas