sjivan / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

Exception if getTopToolbar method invoked on GridPanel object #483

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. check the following code:

// setup Grid before:

GridPanel grid = new GridPanel(Ext.generateId(), width, heigh, store, model);
GridView view = new GridView();
view.setForceFit(true);
grid.setView(view);

// call getTopToolBar

Toolbar topToolbar = grid.getTopToolbar();
if(topToolbar == null){
   topToolbar = new Toolbar();
   grid.setTopToolbar(topToolbar); // error line!
}

if last part changed to:

Toolbar topToolbar = new Toolbar();
grid.setTopToolbar(topToolbar);

code works fine, but it is performed in my Utilities classes where I should
check that toolbar is already created and added to GridPanel or not.

What is the expected output? What do you see instead?
Toolbar was not setup correctly - I've got the following exception on error
line:

java.lang.IllegalStateException: Cannot change configuration property
'tbar' after the component has been created.
    at com.gwtext.client.widgets.Component.error(Component.java:1576)
    at com.gwtext.client.widgets.Component.error(Component.java:1569)
    at com.gwtext.client.widgets.Component.setAttribute(Component.java:1677)
    at com.gwtext.client.widgets.Component.setAttribute(Component.java:1668)
    at com.gwtext.client.widgets.Panel.setTopToolbar(Panel.java:1158)

What version of the product are you using? On what operating system?
GWT-Ext 2.0.5 and GWT 1.5.3; Ubuntu 8.10

Original issue reported on code.google.com by borislav.andruschuk on 27 Mar 2009 at 9:58