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?
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?
Comment