PDA

View Full Version : TabItemConfig.update is not working while obtaining the TabItemConfig from VLC



SenthilMahalingam
22 Sep 2015, 7:17 AM
TabItemConfig.update is not working while obtaining the TabItemConfig from VerticalLayoutContainer, I am using gxt 3.0.6



int count = panel.getWidgetCount();
for (int i = 0; i < count; i++) {
Grid g1 = null;
TabItemConfig configuration;
if (panel.getWidget(i) instanceof VerticalLayoutContainer) {
VerticalLayoutContainer vlc = (VerticalLayoutContainer) panel.getWidget(i);
configuration = panel.getConfig(vlc);
g1 = (Grid) vlc.getWidget(0);
} else {
g1 = (Grid) panel.getWidget(i);
configuration = panel.getConfig(g1);
}
final TabItemConfig config = configuration;

// config from IF condition - panel.update not working

if (config.getText().contains(ClearanceConstants.Test1)) {
if (highlightOneOffTab) {
config.setHTML("<font color = 'red'>" + ClearanceConstants.Test1 + "</font>");
panel.update(g1, config);
} else {
config.setHTML(ClearanceConstants.Test1);
panel.update(g1, config);
}
}

// config from IF condition - panel.update is working
if (config.getText().contains(ClearanceConstants.Test1)) {
if (highlightPendingTab) {
if (criticalIndicator) {
config.setHTML("<font color = 'red'>" + ClearanceConstants.Test1 + "</font>&nbsp;" + "<img src='images/Warning.png' >");
}
if (!criticalIndicator) {
config.setHTML("<font color = 'red'>" + ClearanceConstants.Test1 + "</font>");
}
panel.update(g1, config);
} else {
config.setHTML(ClearanceConstants.Test1);
panel.update(g1, config);
}
}

// config from IF condition - panel.update is working

if (config.getText().contains(ClearanceConstants.Test3)) {
if (highlightCompleteTab) {
config.setHTML(ClearanceConstants.Test3);
panel.update(g1, config);
} else {
config.setHTML(ClearanceConstants.Test3);
panel.update(g1, config);
}
}
}

Gary Schlosberg
22 Sep 2015, 7:25 AM
Thanks for the report. Can you please post a test case which reproduces this issue?
https://fiddle.sencha.com/#home

SenthilMahalingam
22 Sep 2015, 7:48 AM
Thanks for the report. Can you please post a test case which reproduces this issue?
https://fiddle.sencha.com/#home

I am adding 3 tabs in PlainTabPanel as,

PlainTabPanel.add(VerticalLayoutContainer,TabItemConfig)
PlainTabPanel.add(Grid,TabItemConfig)
PlainTabPanel.add(Grid,TabItemConfig)

Now I am trying change the font color of the TabItemConfig in a scenario, I am using update function for that, and it is not working while VerticalLayoutContainer is present in the tab. When Grid is there it is working fine.

SenthilMahalingam
23 Sep 2015, 11:32 AM
It is fixed. Thanks.