PDA

View Full Version : NullPointer in CollumnFooter



fother
18 Jun 2009, 11:01 AM
change the code for this..



public class AggregationGridExample extends LayoutContainer {

@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);

setLayout(new FlowLayout(15));

List<ColumnConfig> configs = new ArrayList<ColumnConfig>();

ColumnConfig column = new ColumnConfig();
column.setId("name");
column.setHeader("Company");
column.setWidth(200);
column.setToolTip("sfsdf");
configs.add(column);

column = new ColumnConfig();
column.setId("last");
column.setHeader("Last");
column.setAlignment(HorizontalAlignment.RIGHT);
column.setWidth(100);
configs.add(column);

column = new ColumnConfig("date", "Last Updated", 100);
column.setAlignment(HorizontalAlignment.RIGHT);
column.setDateTimeFormat(DateTimeFormat.getShortDateFormat());
configs.add(column);

final ListStore<Stock> store = new ListStore<Stock>();
store.add(new ArrayList<Stock>());

ColumnModel cm = new ColumnModel(configs);

AggregationRowConfig<Stock> totals = new AggregationRowConfig<Stock>();
totals.setHtml("name", "Average");

totals.setSummaryType("last", SummaryType.AVG);
totals.setSummaryFormat("last", NumberFormat.getCurrencyFormat());

cm.addAggregationRow(totals);

Grid<Stock> grid = new Grid<Stock>(store, cm);
grid.setBorders(false);
grid.setAutoExpandColumn("name");
grid.setBorders(true);

add(grid);
}
}


stacktrace


[ERROR] Uncaught exception escaped
java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.widget.grid.ColumnFooter.refresh(ColumnFooter.java:221)
at com.extjs.gxt.ui.client.widget.grid.ColumnFooter.onRender(ColumnFooter.java:173)
at com.extjs.gxt.ui.client.widget.Component.render(Component.java:892)
at com.extjs.gxt.ui.client.widget.Component.onAttach(Component.java:1425)

sven
18 Jun 2009, 11:04 AM
That is already fixed in SVN

fother
18 Jun 2009, 11:06 AM
:)