Hakan36
(Hakan Akkurt)
1
Hello,
how can I scroll to top on view change?
Every time if I navigate from a view to the next, I see the middle of view/page instead of top of view…
Unfortunately these code doesn’t work:
setId("VerticalLayout1");
UI.getCurrent().getPage().executeJs("document.getElementById('VerticalLayout1').scrollTop = 0;");
Do you have an another idea ?
Thanks in advance
Martin595
(Martin Israelsen)
2
Hakan36
(Hakan Akkurt)
3
Thanks for your answer.
can you say me in which class I have to add these line:
addAttachListener(event -> UI.getCurrent().getPage().executeJs("document.documentElement.scrollTop = 0;"));
MainLayout.java ? Or my other views, which have the problem witch no scrolling on the top?
Can you give me more informations?
Thanks in advance.