PDA

View Full Version : [CLOSED] Tree Loading style ("my-tree-loading") not cleared after loading



Donald
10 Jul 2008, 12:49 AM
Context: GXT 1.0, Windows XP, IE 7.0, Hosted Mode

I am using a Tree (with Proxy and Binder) and I experience, that the wait-icon, which is bound to the style "my-tree-loading" is not removed, even though there is no error elsewhere.

I have set a breakpoint in TreeItemUI.onLoadingChange to see when the style is removed, and indeed the function is called and should therefore remove the wait-icon from the parent tree item.

I am using a RpcProxy and TreeBinder.

Thanks for your help.

darrellmeyer
14 Jul 2008, 8:23 PM
I am not sure what is happening based on your description. Does this happen always? and for all items when expanded? If you could put together some test code that shows the issue it would be very helpful as I am not able to replicate. I did fix another bug with the tree binder a few days ago that could possible be related but I am not sure.

Donald
15 Jul 2008, 2:00 AM
Hi Darell,

I am posting some code snapshots to give you the full picture.
It seems that the whole tree organization gets confused. It happens sometimes that a tree is expanded and shows a child which should appear somewhere else.



The proxy based loader (see futher down) is a bit special.
The special thing in my example is that the nodes directly under the root are retrieved without proxy access. This first level works fine as it is redered correctly. However clicking to one the nodes an async proc is triggered and executes without error and ends up correclty in the RpcProxy / Treeloader and BaseLoader methosds (I have debugged this extensively).

Thanks for your help.



private Tree initTree() {

tree = new Tree();

tree.addListener(Events.SelectionChange, new Listener<TreeEvent>() {
publicvoid handleEvent(TreeEvent te) {
TreeItem item = te.tree.getSelectedItem();

if (item != null) {

selected = (D) item.getModel();

showSelectionDetails(selected);
}
}
});

treeLoader = new BaseTreeLoader<D>(getProxy()) {
@Override

publicboolean hasChildren(D parent) {
return !isLeaf(parent); // is dummy?

}
};

store = new TreeStore<D>(treeLoader);
store.setStoreSorter(getStoreSorter());


TreeBinder<D> binder = new TreeBinder<D>(tree, store);

binder.setStringProvider(getLabelProvider());
binder.setIconProvider(getIconProvider());


returntree;

}




@Override

protected RpcProxy<DataProvider, List<DataProvider>> getProxy() {
RpcProxy<DataProvider, List<DataProvider>> proxy = new RpcProxy<DataProvider, List<DataProvider>>() {
@Override

protectedvoid load(DataProvider config,
final AsyncCallback<List<DataProvider>> callback) {
if (config == null) {
List<DataProvider> result = new ArrayList<DataProvider>(
Locator.Type.values().length);
for (Locator.Type t : Locator.Type.values()) {

DataProvider item = new DataProvider();
item.setSymbol(DataProviderDetailView.this.symbol);
Locator loc = new Locator();

// setting ID to 0 indicates a dummy element

loc.setId(0L);
loc.setType(t);
item.setLocator(loc);

result.add(item);
}
callback.onSuccess(result);

} else {
DataProviderRemote.Util.getInstance().getDataProvider(
config, new AsyncCallback<List<DataProvider>>() {

publicvoid onFailure(Throwable arg0) {
callback.onFailure(arg0);

}

publicvoid onSuccess(List<DataProvider> arg0) {
callback.onSuccess(arg0);

}

});
}
}
};
return proxy;
}

darrellmeyer
15 Jul 2008, 6:39 AM
Ok, with the new information you gave me I am pretty sure this is related to a issue with TreeLoader that has been fixed. Please try your code again when 1.0.1 is released.

Donald
21 Jul 2008, 10:08 PM
Hi Darell,

I have just tried out the latest version and the issue with the tree still exists.
is there anything I can try out for you to help?

Rgds,
Donald

darrellmeyer
22 Jul 2008, 10:27 AM
If you can put together some test code in this format (http://extjs.com/forum/showthread.php?t=40289) I will take a look.

Donald
23 Jul 2008, 7:15 AM
Hi Darell,

please find attached a small example for my issue (format is an Eclipse Project).
After starting the module a tree appears which is fine.
Click on the first node (quote) and a child opens, which is fine.
then click on the second node (News) and the wait icon will not stopp and the whole order gets disrupted.

If you need further details please let me know.
Thanks in advance,
Donald

darrellmeyer
23 Jul 2008, 8:35 AM
You have a bug in your code. DatooObject equals is returning true when both ids equal null which is wrong. If I comment out your equals method the code works fine.