You should call:

  tabData.setText("New text for tab");
  TabPane.setTabData(component, tabData);

That will fire the appropriate event.

FYI, the fact that you can call the listeners yourself is a bug. The contents 
of the listener list are not supposed to be visible.  :-)

G

On Jun 14, 2011, at 4:13 PM, Edvin Syse wrote:

> The TabData#title on my TabPane tab might change during editing of a domain 
> object, and I find I have to do the following to update the tab correctly:
> 
>        tabData.setText("New text for tab");
>        TabPane tabPane = (TabPane) getParent(); // The actual tab (this) is a 
> BoxPane
>        for (TabPaneAttributeListener l : 
> tabPane.getTabPaneAttributeListeners())
>            l.tabDataChanged(tabPane, this, tabData);
> 
> If I don't notify the listers, the TabData is re-rendered if I hover over the 
> Tab, but if the new text takes more space, the tab isn't expanded to show all 
> the text. I suspect this is as it should be, but maybe there is a better way 
> to notify TabData changes?
> 
> -- Edvin

Reply via email to