1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    11
    Vote Rating
    0
    Ltty is on a distinguished road

      0  

    Question Exception using CheckBoxSelectionModel

    Exception using CheckBoxSelectionModel


    Whenever I use the CheckBoxSelectionModel I get a NPE the first time a data grid loads. However, if I reload the grid using Ctrl + F5, everything works out fine. This is what I get:

    Code:
    java.lang.NullPointerException: null
        at com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel$2.handleEvent(CheckBoxSelectionModel.java:80)
        at com.extjs.gxt.ui.client.widget.grid.CheckBoxSelectionModel$2.handleEvent(CheckBoxSelectionModel.java:1)
        at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
        at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
        at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:456)
        at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:439)
        at com.extjs.gxt.ui.client.widget.grid.Grid.afterRenderView(Grid.java:728)
        at com.extjs.gxt.ui.client.widget.grid.Grid$1.run(Grid.java:711)
        at com.google.gwt.user.client.Timer.fire(Timer.java:149)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
        at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
        at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
        at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
        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:213)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        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:172)
        at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
        at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
        at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
        at java.lang.Thread.run(Thread.java:662)
    My code:
    Code:
    grid = new Grid<BeanModel>(model, colDef);
    
    	selectionModel = new CheckBoxSelectionModel<BaseModel>();
    	this.add(selectionModel.getColumn());  
    ...
    
    			grid.setAutoExpandColumn(autoExpandValue);
    			grid.setAutoHeight(true);
    			grid.setBorders(true);
    			grid.setSelectionModel(selectionModel);
    			grid.addPlugin(selectionModel);
    			table.add(grid);

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Have you tried to reproduce this in a small, standalone testcase implementing EntryPoint? It would be good to understand why you get the exception.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    11
    Vote Rating
    0
    Ltty is on a distinguished road

      0  

    Default


    It seems that there is a problem if I assign the content panel to an element within the UiBinder. I could fix this by reassigning and recreating the table whenever I get new grid data.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    If you could provide a testcase that we could simple run, than we would really like to fix this issue. But to fix this, we first need to understand the problem. Normally when the ViewReady event fires, the gridview should already have a columnheader (which seems to be null in your case, but i am just guessing).

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    11
    Vote Rating
    0
    Ltty is on a distinguished road

      0  

    Default


    Here is the code that caused the problem. I provide the ColumnModel from an external factory to keep the table widget modular. In order to get the code working, I just put the stuff from the constructor to the initialize method.

    The same issue occurs if I place the table.setTopComponent(toolBar); command directly in the setToolbar() method. Don't worry, I checked if I called the setToolbar() method before the initialize() method. If you do that the toolbar only appears if you reload the example a second time. However, this does not throw an exception.

    TableWidget.zip

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar