PDA

View Full Version : [2.0.1] IndexOutOfBoundsException on layout()



cormet
3 Aug 2009, 7:31 PM
Hi All,

I'm having problem after migrating GXT 1.2.4 to 2.0.1 and having the IndexOutOfBoundsException.

Basically I have a tab with a event that listen to it:


TabItem tabItem = new TabItem();
tabItem.setItemId("InvoicesTab");
tabItem.setClosable(false);
tabItem.setText("Invoices");
tabItem.setLayout(new FillLayout());


tabItem.addListener(Events.Select, new Listener<TabPanelEvent>() {
public void handleEvent(TabPanelEvent aEvent) {
initInvoiceTabWidget();
}
});
add(tabItem);

public void initInvoiceTabWidget() {
TabItem invoiceTabItem = getItemByItemId("InvoicesTab");

if(mInvoiceTabWidget == null) {
mInvoiceTabWidget = new InvoiceTabWidget();
invoiceTabItem.add(mInvoiceTabWidget);
invoiceTabItem.layout();

if(mEnableInvoiceInit) {
// init
mInvoiceTabWidget.init();
}

}
}


The code crash on invoiceTabItem.layout() method called. Well, it is working fine GXT 1.2.4 however it does not working
on GXT 2.0.1

Here are the stack trace. Please give me a hand on this migration since the documentation is very limited. Thanks



[ERROR] Uncaught exception escaped
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.set(ArrayList.java:337)
at com.extjs.gxt.ui.client.widget.layout.TableLayout.getNextCell(TableLayout.java:273)
at com.extjs.gxt.ui.client.widget.layout.TableLayout.renderComponent(TableLayout.java:399)
at com.extjs.gxt.ui.client.widget.Layout.renderAll(Layout.java:249)
at com.extjs.gxt.ui.client.widget.layout.TableLayout.onLayout(TableLayout.java:394)
at com.extjs.gxt.ui.client.widget.Layout.layout(Layout.java:96)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:348)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.doLayout(Container.java:364)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:444)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:241)
at com.extjs.gxt.ui.client.widget.Container.layout(Container.java:427)
at com.extjs.gxt.ui.client.widget.LayoutContainer.layout(LayoutContainer.java:236)
at com.x.client.ui.quickbill.QuickBillTab.initInvoiceTabWidget(QuickBillTab.java:102)
at com.x.client.ui.quickbill.QuickBillTab$2.handleEvent(QuickBillTab.java:90)
at com.x.client.ui.quickbill.QuickBillTab$2.handleEvent(QuickBillTab.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:444)
at com.extjs.gxt.ui.client.widget.TabPanel.setSelection(TabPanel.java:717)
at com.extjs.gxt.ui.client.widget.TabPanel.onItemClick(TabPanel.java:1010)
at com.extjs.gxt.ui.client.widget.TabItem$HeaderItem.onClick(TabItem.java:150)
at com.extjs.gxt.ui.client.widget.TabItem$HeaderItem.onComponentEvent(TabItem.java:100)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:760)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1320)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1299)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1262)
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:71)
at org.eclipse.swt.internal.carbon.OS.SendEventToEventTarget(Native Method)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2914)
at com.google.gwt.dev.SwtHostedModeBase.processEvents(SwtHostedModeBase.java:235)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop(HostedModeBase.java:558)
at com.google.gwt.dev.HostedModeBase.run(HostedModeBase.java:405)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:232)

sven
4 Aug 2009, 1:12 AM
Can you please post a proper testcase for this?