-
14 Jul 2010 11:04 AM #1
[FNR] [Removing an Item of a Grouping Grid grouped by a nested property
[FNR] [Removing an Item of a Grouping Grid grouped by a nested property
- Detailed description of the problem
I have a grid grouped by for example store.groupBy("industry.name") where industry is a custom type (extending BaseModel or implementing BeanModelTag) and has a string property called name.
If I remove an item from the store I get a JavaScriptException.
Below is the stacktrace showed on the GWT Develoment Mode Console and a slightly modified version of the grouping grid example to support a graph of custom type objects.
PHP Code:com.google.gwt.core.client.JavaScriptException: (TypeError): 'null' is null or not an object
number: -2146823281
description: 'null' is null or not an object
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:195)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.GeneratedMethodAccessor151.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
- GXT version
2.1.1
- Host mode / web mode / both
Both
- Browser and version
I tested it on IE8, FF3.6, Chrome 6 Dev
- Operating System
Windows XP SP3
- Sample code
PHP Code:public class Test implements EntryPoint {
@Override
public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.add(new GroupingGridExample());
RootPanel.get().add(viewport);
}
public class GroupingGridExample extends LayoutContainer {
@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setLayout(new FlowLayout(10));
GroupingStore<Stock> store = new GroupingStore<Stock>();
store.add(TestData.getCompanies());
store.groupBy("industry.name");
ColumnConfig company = new ColumnConfig("name", "Company", 60);
ColumnConfig industry = new ColumnConfig("industry.name", "Industry", 20);
List<ColumnConfig> config = new ArrayList<ColumnConfig>();
config.add(company);
config.add(industry);
final ColumnModel cm = new ColumnModel(config);
GroupingView view = new GroupingView();
view.setShowGroupedColumn(false);
view.setForceFit(true);
view.setGroupRenderer(new GridGroupRenderer() {
public String render(GroupColumnData data) {
String f = cm.getColumnById(data.field).getHeader();
String l = data.models.size() == 1 ? "Item" : "Items";
return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";
}
});
Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setView(view);
grid.setBorders(true);
ContentPanel panel = new ContentPanel();
panel.setHeading("Grouping Example");
panel.setCollapsible(true);
panel.setFrame(true);
panel.setSize(700, 450);
panel.setLayout(new FitLayout());
panel.setTopComponent(getToolBar(grid));
panel.add(grid);
add(panel);
}
private ToolBar getToolBar(final Grid<Stock> grid) {
ToolBar toolbar = new ToolBar();
toolbar.add(new Button("Remove Item",
new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
Stock itemToRemove = grid.getStore().getAt(0);
grid.getStore().remove(itemToRemove);
}
}));
return toolbar;
}
}
}
PHP Code:public class Stock extends BaseModel {
public Stock() {
}
public Stock(String name, Industry industry) {
set("name", name);
set("industry", industry);
}
public Industry getIndustry() {
return get("industry");
}
public String getName() {
return (String) get("name");
}
}
PHP Code:public class Industry extends BaseModel {
public Industry() {
}
public Industry(String name) {
set("name", name);
}
public String getName() {
return (String) get("name");
}
}
PHP Code:public class TestData {
public static List<Stock> getCompanies() {
Industry manufacturing = new Industry("Manufacturing");
Industry computer = new Industry("Computer");
List<Stock> stocks = new ArrayList<Stock>();
stocks.add(new Stock("3m Co", manufacturing));
stocks.add(new Stock("Alcoa Inc", manufacturing));
stocks.add(new Stock("Intel Corporation", computer));
stocks.add(new Stock("International Business Machines", computer));
return stocks;
}
}
- Detailed description of the problem
-
14 Jul 2010 12:29 PM #2
-
14 Jul 2010 12:31 PM #3
-
15 Jul 2010 5:40 AM #4
I searched but I don't see that similar post, sorry...
There is any estimated time for the release 2.2? (The roadmap http://www.sencha.com/products/gwt/roadmap.php is not updated).
Thanks
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FNR] GridView refreshRow javascript exception w/ grouping grid
By jonjanisch in forum Ext GWT: Bugs (2.x)Replies: 3Last Post: 2 Feb 2011, 10:53 AM -
[FNR] Grid.reconfigure shows the grouped column even if setted to false
By Nico33 in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 15 Mar 2010, 7:09 AM -
Grouping Grid not grouped
By sanjshah in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 29 Oct 2009, 3:02 AM -
Multiple levels of grouping in grouped grid?
By jfizer in forum Ext 2.x: Help & DiscussionReplies: 8Last Post: 28 Jul 2008, 1:37 AM


Reply With Quote