PDA

View Full Version : [BUG] TabItem throws exception with RowLayout(Orientation.HORIZONTAL)



negge
25 Jun 2008, 8:56 PM
TabItem throws an exception with setLayout(new RowLayout(Orientation.HORIZONTAL));


If you setLayout(new RowLayout(Orientation.VERTICAL)); it renders fine.



import com.extjs.gxt.ui.client.Style.Orientation;
import com.extjs.gxt.ui.client.widget.ContentPanel;
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.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

class SettingsTabItem extends TabItem {

public SettingsTabItem() {
setText("Settings");
}

protected void onRender(Element _parent,int _index) {
super.onRender(_parent,_index);

setLayout(new RowLayout(Orientation.HORIZONTAL));

add(new ContentPanel());
add(new ContentPanel());
}
}

public class TestProject implements EntryPoint {

public void onModuleLoad() {
final Viewport viewport=new Viewport();
viewport.setLayout(new FillLayout());
RootPanel.get().add(viewport);

ContentPanel content=new ContentPanel();
content.setBorders(false);
content.setHeaderVisible(false);
content.setLayout(new FitLayout());
viewport.add(content);

TabPanel tabPanel=new TabPanel();
tabPanel.setTabScroll(true);
tabPanel.setBorderStyle(false);
tabPanel.setBodyBorder(false);
content.add(tabPanel);

tabPanel.add(new SettingsTabItem());
}

};Nathan

negge
25 Jun 2008, 10:23 PM
Fixed in SVN