Auto scroll to top of window when window is activated

First of all, Happy Holidays to the IA folks and to the members of this forum.

My question is this: When I use a tab strip to navigate between my windows, it seems like whenever I go back to a window that I had scrolled down on, it shows the window at that same scroll position.

I would like to force the window to scroll to the top every time it is activated.

How can this be done?

Thanks in advance.

Best regards,

I’m taking this to mean some table or list inside a window? Windows themselves don’t really scroll…

The easiest way to do this would be to set the window’s cache policy to “never”. (this is an expert property of the window. This will cause the window to be recreated fresh every time it is opened, instead of caching. The downside, of course, is that it will take a bit longer to open the window each time.

The other alternative would be to put scripting code in the window’s internalFrameActivated event, programmatically scrolling the component in question up. I’d need a bit more info to be able to help more specifically on this front.

Okay, I have a window called “Home”. Its dimensions are 1,000 x 1,600 so when the window is shown, there is a scroll bar on the right side so I can scroll to the bottom of the page.

I scroll down to click on a button to navigate to a new window.

Then, when I navigate back to the Home window, it shows up at the bottom of the window, right where it was when I navigated away from it. It would be great if when this window shows up again, the scroll bar is all the way at the top.

I also notice that when navigating with the tab strip, the previous windows never close. If I go to the “Windows” menu at the top, I can select any of the windows that were previously opened. Do I need to script a closeWindow event to close the original window after the new window is shown?

Sorry for all the questions…

I think I know what you’re doing. You have your main windows floating an non-maximized.

Instead, I recommend increasing your Project Minimum Size if you need such large windows and then setting your main window to Maximize on Startup. This will allow your tab strip to automatically detect the main window and correctly perform swaps instead of opens, which won’t leave all of your windows open.

Check out the Skeleton project for an example of how we typically do navigation.

Thanks for the pointer. I will try this methodology out with my project. Thanks again!