I've learned some things reading this thread. nice. :)
looks like there are some easier ways of doing things than how i'm
doing my scrolling, and this would probably be not the easiest, but
i'll mention it for completeness. it's also possible to do the
browser window scrolling in javascript, and make a JSNI call to the
javascript function to do it. i'm currently using this method to
simulate a page refresh:
function scrollToTop() {
window.scroll( 0, 0 );
}
and the corresponding GWT JSNI method:
public native void jsScrollWindowToTop() /*-{
$wnd.scrollToTop();
}-*/;
just one more option.
On Apr 12, 11:19 am, Brandon Turner <[email protected]> wrote:
> You can get away without a ScrollPanel if you want to as well. Something
> like:
>
> verticalPanel.getElement().setScrollTop(secondFlexTable.getElement().getAbsoluteTop());
>
> -Brandon
>
> On Mon, Apr 12, 2010 at 12:12 PM, t.dave <[email protected]> wrote:
> > use ScrollPanel.setScrollPosition(). that sets the vertical scroll
> > position of the scrollpanel, which you will need to calculate. try
> > something like this:
>
> > new ClickHandler() {
> > public void onClick( ClickEvent event ) {
> > int tableTop = secondFlexTable.getAbsoluteTop();
> > scrollPanel.setScrollPosition( tableTop );
> > }
> > }
>
> > i suppose in your case it wouldn't be a click handler if you're basing
> > it off the history token, but hopefully this will point you in the
> > right direction.
>
> > On Apr 12, 7:34 am, redlaber <[email protected]> wrote:
> > > I want to scroll page, generated with gwt, to some element. Its should
> > > be simple, but i cannt find the solution. For example: I have a
> > > vertical panel with two flexables. When i get the history token
> > > "goto2" I want to scroll my page to the second table. (Sorry for the
> > > terrible english).
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-web-toolkit%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.