Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt 一个scrollpanel可以有两个ScrollHandler吗?_Gwt_Event Handling_Scroll_Panel - Fatal编程技术网

Gwt 一个scrollpanel可以有两个ScrollHandler吗?

Gwt 一个scrollpanel可以有两个ScrollHandler吗?,gwt,event-handling,scroll,panel,Gwt,Event Handling,Scroll,Panel,我有一个带滚动面板的主面板 嵌入其中的是另外两个面板,一次只显示其中一个。我想在每个面板中捕捉主面板的scrollevent。我在两个子面板中都有一个scrollevent,但只希望触发一个。我该怎么做 谢谢。您可以在滚动面板中添加任意数量的处理程序 因此,在要收听滚动事件的两个面板中: HandlerRegistration handler = scrollPanel.addScrollHandler( new ScrollHandler() { @Override publ

我有一个带滚动面板的主面板

嵌入其中的是另外两个面板,一次只显示其中一个。我想在每个面板中捕捉主面板的scrollevent。我在两个子面板中都有一个scrollevent,但只希望触发一个。我该怎么做


谢谢。

您可以在滚动面板中添加任意数量的处理程序

因此,在要收听滚动事件的两个面板中:

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