PDA

View Full Version : [FNR] TabPanel.update(Widget, TabItemConfig) removes styling



madmaxmatze
14 Nov 2011, 4:09 AM
In order to change the caption for tabs after they have been added, I tried to use TabPanel.update as described here: http://dev.sencha.com/deploy/gxt-3.0.0-dp5/javadoc/gxt/com/sencha/gxt/widget/core/client/TabItemConfig.html

The update itself is working, but the Styling/HTML of the tab header gets fully lost. You can test this issue, with the following code:


public class MyModule implements EntryPoint {
public void onModuleLoad() {

BorderLayoutContainer container = new BorderLayoutContainer();
container.setWidth(500);
container.setHeight(500);

final TabPanel tabs = new TabPanel();

final ContentPanel cp1 = new ContentPanel();
cp1.setHeadingHtml("Tab 1 Headline");
final TabItemConfig tabItem1Config = new TabItemConfig("Tab 1");
tabs.add(cp1, tabItem1Config);

ContentPanel cp2 = new ContentPanel();
cp2.setHeadingHtml("Tab 2 Headline");
TabItemConfig tabItem2Config = new TabItemConfig("Tab 2");
tabs.add(cp2, tabItem2Config);

Button b = new Button("Update the caption for Tab 1");
b.addClickHandler(new ClickHandler () {
@Override
public void onClick(ClickEvent event) {
tabItem1Config.setHTML("New Tab 1");
tabs.update(cp1, tabItem1Config);
}
});

BorderLayoutData layoutData = new BorderLayoutData(100);
container.setCenterWidget(tabs, layoutData);
container.setNorthWidget(b, layoutData);

RootLayoutPanel.get().add(container);
}
}

madmaxmatze
21 Nov 2011, 5:42 AM
Any reaction? Did anybody from the GXT dev team try to reproduce this error with the test case I provided?

sven
21 Nov 2011, 5:47 AM
We bugreport was noted and will be looked into. Please keep in mind that we are still in pre beta stage.

WesleyMoy
29 Nov 2011, 1:12 PM
Thanks for bringing this to our attention. This bug is now fixed in SVN.

SenthilMahalingam
18 Sep 2015, 10:11 AM
Thanks for bringing this to our attention. This bug is now fixed in SVN.

I am facing the same issue with 3.0.6. What should I do now ?