Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Multiple TabDeselectedEvents originating from one Tab

    Hello --

    I have a question regarding the firing of TabDeselectedEvents. Specifically, I would appreciate any insight into why I am seeing multiple TabDeselectedEvents originating seemingly sequentially from the same Tab when an alternate Tab is clicked.

    I see this behavior in Chrome, Firefox and Internet Explorer. The code in question resembles the following:

    Code:
    HLayout applicationLayout = new HLayout();
    TabSet tabSet = new TabSet();
    tabSet.setSize("1024px", "640px");
    		
    Tab tabOne = new Tab("Tab One");
    tabOne.addTabDeselectedHandler(new TabDeselectedHandler() {
         @Override
        public void onTabDeselected(TabDeselectedEvent event) {
                 event.cancel();
        }
    });
    tabSet.addTab(tabOne);
            
    Tab tabTwo = new Tab("Tab Two");
    tabSet.addTab(tabTwo);
            
    applicationLayout.addMember(tabSet);
    Tab tabOne is selected by default.

    When clicking on tabTwo, two (and sometimes three, particularly in Internet Explorer) separate TabDeselectedEvents are fired from tabOne. If I set a breakpoint on

    Code:
    event.cancel();
    within tabOne's TabDeselectedHandler's onTabDeselected() method, the debugger visits this line two or three times based upon Tab tabOne's firing of separate TabDeselectedEvents before continuing. After all of these events are handled, one is returned to the user interface where tabOne remains selected.

    I anticipated that only one TabDeselectedEvent would be fired by tabOne when tabTwo was clicked. Can anyone shed light on why more than one event is fired?

    Thanks and regards,

    Brad D. Andersen
    AZAD Consultant - ARRIS Group, Inc.
Working...
X