Can I have Two scrollhandlers for one scrollpanel?

I have a main panel with a scrollpanel.

Embedded in that are two other panels of which only one is shown at a time. I want to catch the scrollevent of the main panel in each of these panels. i have a scrollevent in both the child panels but want just one to be triggered. how do i do this?

Thanks.

Answers


You can add as many handlers as you like to a ScrollPanel.

So in both panels where you want to listen to the scroll event:

HandlerRegistration handler = scrollPanel.addScrollHandler( new ScrollHandler() {
    @Override 
    public void onScroll( ScrollEvent event ) {
       // ... your code
    }
);

Need Your Help

CALayer with Animation on Scroll View

uiscrollview calayer

So, I have a CALayer added to a UIScrollView that does some path animations. In my application, I resize the scroll view and shift everything to create a "negative" region. Using contentOffset with

Can tab layout of LayoutAnchorablePane be changed?

c# wpf avalondock

I'm new to AvalonDock, and as I'm currently understanding it, whenever I float a LayoutAnchorable from a DockingManager, it will be put in a new LayoutAnchorablePane instead of a LayoutDocumentPane...