Hi,

I try to load a treepanel from an xml file. The file is about one hundred records, so it doesn't need to be loaded in Async mode.

I tried doing this with the explorer examples but I've got tree problems

1/ After rendering, I just see the firts leaf, all the other are not visible but are clickables (!)
2/ The leafs and folders are on the same level (folders do not contain the leafs)
3/ When I click an a Folder icon, all the same tree appears (Aync mode ?)

Here is my java code :

Code:
private void createTreeContent() {

         RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "http://localhost/ref_village.xml");  
         HttpProxy<ListLoadResult<ModelData>> proxy = new HttpProxy<ListLoadResult<ModelData>>(builder);  
           
         ModelType type = new ModelType();  
         type.setRecordName("village");  
         type.setRoot("villages");
         type.addField("folder","@folder");
         type.addField("code","@code");  
         type.addField("nom","@nom");  
         type.addField("pays","@pays");    
         type.addField("nbTrident","@nbTrident");  
         
         XmlReader<List<ModelData>> reader = new XmlReader<List<ModelData>>(type);  
           
         TreeLoader<ModelData> loader = new BaseTreeLoader<ModelData>(proxy, reader) {  
           @Override  
           public boolean hasChildren(ModelData parent) {  
            return "true".equals(parent.get("folder")); 
           }  
           
           @Override  
           protected Object prepareLoadConfig(Object config) {  
             // by default the load config will be the parent model  
             // http proxy will set all properties of model into request  
             // parameters, so the model name and id will be passed to server  
             return super.prepareLoadConfig(config);  
           }  
         };  
           
         store = new TreeStore<ModelData>(loader);  
           
         TreePanel<ModelData> tree = new TreePanel<ModelData>(store);  
         tree.setDisplayProperty("nom");  
         
         tree.setWidth(250);  
           
         loader.load();  

         
         tree.addListener(Events.OnClick, new Listener<TreePanelEvent<Village>>() {
                public void handleEvent(TreePanelEvent<Village> be) {
                    if (be.getNode().isLeaf()){
                        ModelData m = be.getNode().getModel();
                        System.out.println(m.get("code"));
                        String codeToDispatch = m.get("code");
                        dispatchDescriptifVillage(codeToDispatch);
                    }
                }
            });

        filter.setFieldLabel("Code village");
        filter.bind(store);


        VerticalPanel panel = new VerticalPanel();
        panel.addStyleName("x-small-editor");
        panel.setSpacing(8);
        panel.add(tree);
        treeItem.add(panel);

    }
Here is a part of the XML :
HTML Code:
<villages>
<village folder="true" code="" nom="Afrique - Moyen Orient" pays=""    nbTrident="">
    <village folder="false" code="AGAC" nom="Agadir" pays="Maroc"    nbTrident="3"/>
    <village folder="false" code="BELC"  nom="Beldi"   pays="Turquie"  nbTrident="3"/>
</village>