PDA

View Full Version : [FIXED] TreePanel setChecked always fails



Cputerace
22 Jun 2009, 9:40 AM
package com.mycompany.gwtprototype.client;

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.BaseTreeModel;
import com.extjs.gxt.ui.client.store.TreeStore;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.treepanel.TreePanel;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class GwtPrototype implements EntryPoint {

private Viewport v = new Viewport();

public void onModuleLoad() {
RootPanel.get().add(v);
v.setHeight("100%");
v.setLayout(new FitLayout());
TreeStore<BaseModelData> ts = new TreeStore<BaseModelData>();
TreePanel<BaseModelData> tp = new TreePanel<BaseModelData>(ts);
tp.setCheckable(true);
v.add(tp);
v.layout();
BaseTreeModel btm = new BaseTreeModel();
ts.add(btm, true);
tp.setChecked(btm, true);
}

}setChecked never works because, as far as i can tell, the below code:

if (node != null && node.check != null)never passes due to node.check never being changed in the code. node.check is set in getCheckElement and onCheckChange in treepanelview, neither of which happen.

darrellmeyer
22 Jun 2009, 1:47 PM
Fixed in SVN.

Cputerace
22 Jun 2009, 3:58 PM
Darrell,
Thanks for the quick fix. Is there something I can do/override quickly in mine to get around the issue temporarily? If not, any ETA on the next release?

Thanks

darrellmeyer
23 Jun 2009, 7:34 AM
RC1 one will be out in a day or two.