Announcement

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

    TabCloseClickEvent gets the wrong value on event.getTab().getAttribute(...)

    Hi guys,


    My interface using tabs is setting few values on tabs using tab.setAttribute(...). Also, some events on my interface sets new values on the same property.

    The problem starts when I try get the value on TabCloseClickEvent. I always get the old value.

    The code is something like this:

    public void createTab() {
    Tab tab = new Tab();
    tab.setAttribute("myProperty", "value 1");
    tabSet.add(tab, 0);
    }

    public void somethingHappened() {
    Tab tab = tabSet.getTab(0);
    tab.setAttribute("myProperty", "value 2");
    }

    ...
    tabSet.addCloseClickHandler(new CloseClickHandler() {
    @Override
    public void onCloseClick(TabCloseClickEvent event) {
    SC.say(event.getTab().getAttribute("myProperty")); //show value 1
    // or even
    Tab tab = tabSet.getTab(0);
    SC.say(tab.getAttribute("myProperty") ); // wrong value too
    }
    });


    But, If you try the same code on TabSelectedHandler (or a simple button) works perfectly.

    tabSet.addTabSelectedHandler(new TabSelectedHandler() {
    @Override
    public void onTabSelected(TabSelectedEvent event) {
    SC.say(event.getTab().getAttribute("myProperty"));
    }
    });


    bug?

    #2
    I get the same thing, does look like a possible bug.

    Comment


      #3
      I tested in all ways.
      I really think is a bug.

      Where should I report bugs?

      Comment


        #4
        Well, doing some tests I discovered that if you call a simple line like bellow after update the attribute

        SC.say(tabSet.getTab(0).getAttribute("myProperty"));

        when you close the tab you will get the value updated.

        weird...

        Anyway, for now, i had to write a ugly code to by pass this problem.

        If any dev read this, please, let me know if is really a bug and if will have a fix sometime.


        thanks

        Comment


          #5
          Simple code to test attached. Good Luck.
          Attached Files
          Last edited by sonnerdev; 18 Jun 2010, 11:03.

          Comment

          Working...
          X