Announcement

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

    Tab closed event

    Hello,
    I need to respond when a user close a tab in a tabset. So I added a CloseClickHandler to my tabset in this way:

    Code:
    tabSet.addCloseClickHandler(new CloseClickHandler() {
                public void onCloseClick(TabCloseClickEvent event) {
                    SC.say("close!");
                }});
    Ok, the event is fired and that's fine. But... the tab doesn't close. So, is there a way to call the default CloseClickHandler or do I have to replicate its behaviour by rewriting it?

    Thank you for your response!

    #2
    Hi zerozerosette,

    Subscribing to this event actually turns off the default behavior of removing the tab off. This will be corrected, but in the meantime, removeTab() could be called to restore the original functionality.

    Comment


      #3
      Thank you very much. I'll try that as soon as possible.

      Comment


        #4
        TabSet.addCloseClickHandler no longer cancels to close action of the tab. Registering this handler simply notifies you that the tab close icon was clicked. If you do want to cancel the tab from closing, simple call CloseClickEvent.cancel() from within your event handler.

        Sanjiv

        Comment


          #5
          Hi,

          I tried this with yesterdays nightly build (build 491), and it seems to me that the "solution" is that onCloseClick method isn't called at all ;-)
          It could be something that I'm doing wrong, I just replaced the old smargwt.jar with the new one, recompiled, and then I was able to close the tabs again, but I had a GWT.log(...) statement inside the CloseClickHandler which didn't show up.

          Comment


            #6
            Please update from SVN. (492 or greater).

            Comment


              #7
              Thanks, now it's working great!

              Comment

              Working...
              X