1. #1
    Sencha User
    Join Date
    Oct 2008
    Posts
    23
    Vote Rating
    0
    danic is on a distinguished road

      0  

    Default Exception in Groupped Grid

    Exception in Groupped Grid


    Hello guys.

    I have a problem with a grouping grid and I do not know how to fix it. I am creating a grid which has a grouping view associated. The problem is that I receive the following NPE:

    [ERROR] Uncaught exception escaped
    java.lang.NullPointerException: null
    at com.extjs.gxt.ui.client.widget.grid.GridView.renderUI(GridView.java:1564)
    at com.extjs.gxt.ui.client.widget.grid.GridView.render(GridView.java:1520)
    at com.extjs.gxt.ui.client.widget.grid.Grid.afterRender(Grid.java:610)
    at com.extjs.gxt.ui.client.widget.Component.render(Component.java:961)

    The problem is that the templates member of the GroupingView class is not properly initialized. I walked the code a little bit and I noticed that the method

    protected void initTemplates() {
    templates = GWT.create(GridTemplates.class);
    }

    doesn't do what it is supposed to do, leaving the templates member uninitialized.

    I searched the forum for a response, but the compiler trick (using the same java version both in Eclipse and in the JAVA_HOME variable) doesn't work. I am using JDK version 1.6.0_10.

    Anybody can give me some useful advice...?

    Thanks in advance!

    Regards,
    Dani

  2. #2
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    mhhh i searched hours for it, but i can not find the templates for gridview in the source path :-(


    i found it after hours because of this thread:

    GridTemplates, private and hidden resource?
    http://www.extjs.com/forum/showthrea...ight=templates


    and there is the place for the html files are in the gxt.jar :-)

    so it looks there is a problem with your gxt.jar

    also try this threads:
    Error in creating Grid: Deferred binding
    http://www.extjs.com/forum/showthread.php?t=59020

    Computing all possible rebind results for 'com.extjs.gxt.ui.client.widget.grid.GridTe
    http://www.extjs.com/forum/showthread.php?t=59580
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    PS:

    why the template files are only in the gxt.jar and not in the src?
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  4. #4
    Sencha User
    Join Date
    Oct 2008
    Posts
    23
    Vote Rating
    0
    danic is on a distinguished road

      0  

    Default


    Hello Arno and thanks for your answers.

    The template files that are needed are contained within gxt.jar (GridTemplates#body.html, etc - one for each method of the GridTemplates pseudo-interface) - also in my gxt.jar (standard, from the Download section).

    I have also read all the mentioned threads and tried the given solutions before opening this one. The template files are in place, the java compiler seems to be ok... I do not have any clues about what the problem might be.

    Any other ideas...?

    Regards,
    Dani

  5. #5
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    and the compiler dont output some warnings or errors?
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  6. #6
    Sencha User
    Join Date
    Oct 2008
    Posts
    23
    Vote Rating
    0
    danic is on a distinguished road

      0  

    Default


    No, I even compiled the application in "Spam" mode, still no result or warning.

  7. #7
    Sencha User
    Join Date
    Oct 2008
    Posts
    23
    Vote Rating
    0
    danic is on a distinguished road

      0  

    Default


    Ok, the problem is solved. However, this is a little bit confusing: the reason for that exception (and for the inability to load the templates) is that the GroupingView was created and assigned to the grid in the grid's onRender() method. Is this how it should work? Is this documented somehow?

    Regards,
    Daini

  8. #8
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    can you please explain HOW you have solved it? pls also with a code snippet.
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  9. #9
    Sencha User
    Join Date
    Oct 2008
    Posts
    23
    Vote Rating
    0
    danic is on a distinguished road

      0  

    Default


    @Arno: Have you read my last post?

    I think it is quite self-explaining: I've moved the creation of the GroupingView from the onRender() method to the constructor. I cannot give code-snippets because this is part of a large application.

    Regards,
    Dani

  10. #10
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    yes i read it many times :-)

    but there was no hint about moving the creation of GroupingView to an other place



    also because there was no code how you have done this creation before you solved the problem, no info that you have created the grouping view in an overwritten onRender. pls compare: in this example the grouping view also not created in onRender http://www.extjs.com/examples/explorer.html#grouping

    and i was thinking you point to this line in onRender "view.init(this);" when you described it with this text "GroupingView was created and assigned to the grid in the grid's onRender() method")

    sorry, but your text without small code snippets is not that much self explainig ;-)


    but thanks for detailed description of your solution :-)
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

Thread Participants: 1