Hi.

I want to create TreeGrid for this model:

Code:
public class Criteria implements Serializable {


    int id;
    String description;
    Rubric rubric;


    public Criteria() {
    }
    public Criteria(int id) {
        super();
        this.id = id;
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public Rubric getRubric() {
        return rubric;
    }
    public void setRubric(Rubric rubric) {
        this.rubric = rubric;
    }
}

public interface CriteriaProp extends PropertyAccess<Criteria> {


    @Path("id")
         ModelKeyProvider<Criteria> id();


    @Path("description")
    LabelProvider<Criteria>descriptionLabel();


    ValueProvider<Criteria, String> description();
    ValueProvider<Criteria, Rubric> rubric();
    
    @Path("rubric.description") 
    ValueProvider<Criteria, String> rubricDescription();
}


public class Rubric  implements Serializable {


    int id;
    String description;


    public Rubric () {
    }
    public int getId() {
        return id;
    }
    public void setId(int id) {
        this.id = id;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }


}
Rubric.description - must be root element and Criteria.description - child (as grouping by Rubric.description).
I'm trying to do so:
Code:
               RpcProxy<Criteria, List<Criteria>> proxyTree = new RpcProxy<Criteria, List<Criteria>>() {


            @Override
            public void load(Criteria loadConfig,
                    AsyncCallback<List<Criteria>> callback) {
                service.getCriteriaTree(loadConfig, callback);
            }
        };


        final TreeLoader<Criteria> loaderTree = new TreeLoader<Criteria>(
                proxyTree) {
            @Override
            public boolean hasChildren(Criteria parent) {
                return parent.getRubric() instanceof Rubric;
            }
        };


               CriteriaProp props = GWT.create(CriteriaProp.class);        
               TreeStore<Criteria> store = new TreeStore<Criteria>(props.id());
        loaderTree.addLoadHandler(new ChildTreeStoreBinding<Criteria>(store));
        ColumnConfig<Criteria, String> rubcol = new ColumnConfig<Criteria, String>(
                props.rubricDescription(), 150, "Rubric");
        ColumnConfig<Criteria, String> critcol = new ColumnConfig<Criteria, String>(
                props.description(), 500, "Criteria");


        List<ColumnConfig<Criteria, ?>> l = new ArrayList<ColumnConfig<Criteria, ?>>();
        l.add(rubcol);
        l.add(critcol);
        ColumnModel<Criteria> cm = new ColumnModel<Criteria>(l);


        TreeGrid<Criteria> treeGrid = new TreeGrid<Criteria>(store, cm, rubcol);
                loaderTree.load();
////////////////////////////////////////////
        
              //  Impl service:
        @Override
    public List<Criteria> getCriteriaTree(Criteria loadConfig) {
        List<Criteria> sources = null;
        sources = infoManager.getCriteria();
        return sources;
    }
but it's wrong code - display only critcol as root.
Help please write the correct code.

Thanks.