how to go to a widget at the top of the page

97 views
Skip to first unread message

tong123123

unread,
Apr 4, 2012, 11:29:44 PM4/4/12
to google-we...@googlegroups.com
my panel is very long, and I have an FlowPanel for displaying error message at the top of the long panel, there is a "search" button at the bottom of the page, when user press "search", there is validation and if has error, the error is shown on the FlowPanel at the top of page, but the page will not automatically jump to the top of the page to let user see the error message, I try to use a focusPanel to surrounding the error message panel and use focusPanel.setFocus(true) but the page still cannot jump to the focusPanel at the top of the page, so any method I can do?

Jens

unread,
Apr 5, 2012, 4:25:34 AM4/5/12
to google-we...@googlegroups.com
Have you tried to call errorFlowPanel.getElement().scrollIntoView() ? You could also set the vertical scroll position on the ScrollPanel to 0 or call ScrollPanel.scrollToTop().

-- J.

Kei Kei

unread,
Apr 5, 2012, 4:52:26 AM4/5/12
to google-we...@googlegroups.com
I try to call errMsgPanel.getElement().scrollView();
where errMsgPanel is a FlowPanel,
it throws error:
NoSuchMethodError:com/google/gwt/user/client/Element.scrollIntoView()V
at com.ha........

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/PYqESnSsaAsJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Kei Kei

unread,
Apr 5, 2012, 4:56:14 AM4/5/12
to google-we...@googlegroups.com
For more information, I am using GWT 2.4.
the errMsgPanel.getElement().scrollIntoView() is called inside a button clickHandler.

Kei Kei

unread,
Apr 5, 2012, 6:16:25 AM4/5/12
to google-we...@googlegroups.com
the problem disappear now after rebuild the whole project, errMsgPanel.getElement().scrollView(); can function as expect.
thanks
Reply all
Reply to author
Forward
0 new messages