PDA

View Full Version : [FIXED] iconStyle for a TabItem cannot be changed



PeteW
8 May 2008, 3:55 AM
using 1.0 beta 2

Once an iconStyle for a TabItem has been set, it cannot be changed, as demonstrated with the following example.




import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.Button;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.FillLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class SimpleExample implements EntryPoint {


public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FillLayout());

final TabPanel tabPanel = new TabPanel();

final TabItem tab1 = new TabItem();

Button button = new Button("Pushing Me Should Change Icon");
button.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
tab1.setIconStyle("x-tbar-page-last");
tab1.setText("Tab 1 - button pushed");
}
});
tab1.add(button);

tab1.setText("Tab 1");
tab1.setIconStyle("x-tbar-page-first");

tabPanel.add(tab1);

viewport.add(tabPanel);

viewport.layout();
RootPanel.get("slot1").add(viewport);

}
}

darrellmeyer
12 May 2008, 12:17 PM
Thanks for the code sample. The fix in SVN.