PDA

View Full Version : How to save scroll state in TabPanel



sg707
19 May 2008, 9:08 AM
Hello,

I'm very much a GWT noob. I did skim through GWT in Action book though. Anyways I need some help in saving scroll state. For example, when I select different tab and select the previous tab, the scroll state is always back to "top" position. If possible, I like to maintain the scroll state when viewing different tab. In advance, thanks for helping out GWT noobs.

gslender
19 May 2008, 12:42 PM
Container extends ScrollContainer so you should be able to use get/setVScrollPosition(int position) and recall the state and restore between tab selections.

sg707
21 May 2008, 11:33 AM
Container extends ScrollContainer so you should be able to use get/setVScrollPosition(int position) and recall the state and restore between tab selections.

I noticed that method but I couldn't find the right event to trigger that. I looked through Events and tried the Events.BeforeSelect but that holds the currently selected tab items. I'm sure one of the Events type will work but not sure which one. Thanks.

darrellmeyer
22 May 2008, 7:37 AM
The scroll state of should not be reset when switching tabs. I have made several changes to TabPanel. One of those changes is that a tab items layout is not executed when selecting a tab if that tab has already been rendered and the tab panel size has not changed. You can see this post for more info http://extjs.com/forum/showthread.php?t=36336. Your scroll state will not be cleared when switching tabs. Changes are in SVN.

sg707
22 May 2008, 8:46 AM
Are you sure? I just switched to beta3 and also checked your latest online demo for "Tab Panel". When I switch back and forth "GWT" and "Close", it's still resetting the scrollstate to the top. I'm sure you'll fix this one way or another, so let me say great work and appreciate the fix!!! I really can't wait for the tutorials.

Just some suggestions down the road. Any plans for special widgets like FTP or SSH client?

darrellmeyer
22 May 2008, 9:19 AM
This is fixed in SVN. It is not in beta 3.