Results 1 to 5 of 5

Thread: How to use a TreeGrid?

  1. #1
    Sencha User
    Join Date
    Jan 2015
    Posts
    29
    Vote Rating
    1
      0  

    Default How to use a TreeGrid?

    Hello,

    I am using GWT 2.6.0 with Sencha GXT 3.1.1. I am fairly new to GXT. I want to create a TreeGrid.
    I did not find any tutorials, except the documentation:
    http://docs.sencha.com/gxt/3.1/javadoc/com/sencha/gxt/widget/core/client/treegrid/TreeGrid.html

    I clearly followed everything, but when I tried to run it I got the following errors:

    15:51:06.608 [ERROR] [practice] Generator 'com.sencha.gxt.data.rebind.PropertyAccessGenerator' threw an exception while rebinding 'com.example.practice.client.DataProperties'
    java.lang.NullPointerException: null
    at com.sencha.gxt.data.rebind.ModelKeyProviderCreator.getObjectType(ModelKeyProviderCreator.java:34)
    at com.sencha.gxt.data.rebind.ValueProviderCreator.getPackageName(ValueProviderCreator.java:192)
    at com.sencha.gxt.core.rebind.AbstractCreator.create(AbstractCreator.java:31)
    at com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:87)
    at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:676)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:147)
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:600)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:470)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
    at com.google.gwt.core.shared.GWT.create(GWT.java:72)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at com.example.practice.client.Practice.onModuleLoad(Practice.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)



    ----------------------
    --------------------------------------------------------------------------------------------------------------


  2. #2
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223
    Answers
    5
    Vote Rating
    24
      0  

    Default

    Quote Originally Posted by gui0506 View Post
    Hello,

    I am using GWT 2.6.0 with Sencha GXT 3.1.1. I am fairly new to GXT. I want to create a TreeGrid.
    I did not find any tutorials, except the documentation:
    http://docs.sencha.com/gxt/3.1/javadoc/com/sencha/gxt/widget/core/client/treegrid/TreeGrid.html
    Well, there is a TreeGrid at examples:
    http://www.sencha.com/examples/index...:basictreegrid
    Warning! It is not a very good example. These prefixing of keys with "f-" (Folder) and "m-" (Leafs) is cumbersome. No comments whats so ever. Imports of importcom.sencha.gxt.examples.resources. where you have to figure out where to get it from in first place. And so on...
    Quote Originally Posted by gui0506 View Post

    I clearly followed everything, but when I tried to run it I got the following errors:

    15:51:06.608 [ERROR] [practice] Generator 'com.sencha.gxt.data.rebind.PropertyAccessGenerator' threw an exception while rebinding 'com.example.practice.client.DataProperties'
    java.lang.NullPointerException: null
    at com.sencha.gxt.data.rebind.ModelKeyProviderCreator.getObjectType(ModelKeyProviderCreator.java:34)
    at com.sencha.gxt.data.rebind.ValueProviderCreator.getPackageName(ValueProviderCreator.java:192)
    at com.sencha.gxt.core.rebind.AbstractCreator.create(AbstractCreator.java:31)
    at com.sencha.gxt.data.rebind.PropertyAccessGenerator.generate(PropertyAccessGenerator.java:87)
    at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:676)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:147)
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:600)
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:470)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
    at com.google.gwt.core.shared.GWT.create(GWT.java:72)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at com.example.practice.client.Practice.onModuleLoad(Practice.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:411)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)



    ----------------------
    --------------------------------------------------------------------------------------------------------------

    There seems to be something wrong with your Dataprop. Does Dataprop known where to get Data from? Try this:
    Code:
      public interface DataProperties extends PropertyAccess<Data> {
        @Path("name")
        ModelKeyProvider key();
        ValueProvider<Data, String> name();
        ValueProvider<Data, String> value();
       }

  3. #3
    Sencha User
    Join Date
    Jan 2015
    Posts
    29
    Vote Rating
    1
      0  

    Default

    Yes, I tried to add the generic, but no luck...
    I also tried to make "Data" serializable, but still the same issue.
    Is there any thing I need to inherit in the model.xml file in order to use the GXT generator?
    I pasted my code for DataProperties and Data below.


    package com.example.practice.client;


    import com.sencha.gxt.core.client.ValueProvider;
    import com.sencha.gxt.data.shared.ModelKeyProvider;
    import com.sencha.gxt.data.shared.PropertyAccess;
    import com.google.gwt.editor.client.Editor.Path;




    public interface DataProperties extends PropertyAccess<Data>{
    @Path("name")
    ModelKeyProvider key();
    ValueProvider<Data, String> name();
    ValueProvider<Data, String> value();
    }



    package com.example.practice.client;


    import java.io.Serializable;


    public class Data implements Serializable{
    /**
    *
    */
    private static final long serialVersionUID = 5574589962452836701L;
    private String name;
    private String value;


    public Data(String name, String value) {
    super();
    this.name = name;
    this.value = value;
    }
    public String getName() {
    return name;
    }
    public String getValue() {
    return value;
    }
    public void setName(String name) {
    this.name = name;
    }
    public void setValue(String value) {
    this.value = value;
    }
    }

  4. #4
    Sencha User
    Join Date
    Jan 2015
    Posts
    29
    Vote Rating
    1
      0  

    Default

    New Update:I wrote my own ValueProvider and ModelKeyProvider and it worked.I guess now my only problem is how to make the GXT generator work...I tried to only execute GWT.create(DataProperties.class), but failed.

  5. #5
    Sencha User
    Join Date
    Feb 2017
    Posts
    1
    Vote Rating
    0
      0  

    Default

    As I ran into the same Problem and there seems to be no better Google result if you google the Exception than this thread:

    public interface DataProperties extends PropertyAccess<Data> {
    @Path("name")
    ModelKeyProvider<Data> key();
    ValueProvider<Data, String> name();
    ValueProvider<Data, String> value();
    }
    worked for me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •