dany2k
4 Sep 2008, 4:50 AM
Hi,
i just played a bit with GXT 1.0.3/4 and tried to accomplish a Tree, which is loaded asynchronously, but can be filtered using a StoreFilterField. Basically, i merged the two examples from the Async Tree and Filter Tree together. However, two errors/mulfunctions occured:
- When loading ModelData-lists from a server (Which is requrired by the RpcProxy/BaseTreeLoader), they sometimes contain null-elements at the end, though no null-elements have been attached on server-side. This leads to NullpointerExceptions when adding null-Elements to the Tree. However, the same error occurs in the TreeBinder Class when createAll() is called and a filter has been applied (lines 205-213):
TreeItem item = null;
if (store.isFiltered()) {
if (isOrDecendantSelected(null, element)) {
item = createItem(element);
}
} else {
item = createItem(element);
}
tree.getRootItem().add(item);
If the isOrDecendantSelected(null, element) returns false, the item remains null and a NullPointerException is thrown if added to the root item. The bug can be fixed by only adding items which are not null: if (item!=null) tree.getRootItem().add(item);
- When entering a filter string, no items (even those, that match the query string) are displayed anymore. When removing the query string, the Tree remains empty and is not rebuild at all.
Can anyone reproduce the described behaviour, or help to fix the problems?
Regards,
Dany
i just played a bit with GXT 1.0.3/4 and tried to accomplish a Tree, which is loaded asynchronously, but can be filtered using a StoreFilterField. Basically, i merged the two examples from the Async Tree and Filter Tree together. However, two errors/mulfunctions occured:
- When loading ModelData-lists from a server (Which is requrired by the RpcProxy/BaseTreeLoader), they sometimes contain null-elements at the end, though no null-elements have been attached on server-side. This leads to NullpointerExceptions when adding null-Elements to the Tree. However, the same error occurs in the TreeBinder Class when createAll() is called and a filter has been applied (lines 205-213):
TreeItem item = null;
if (store.isFiltered()) {
if (isOrDecendantSelected(null, element)) {
item = createItem(element);
}
} else {
item = createItem(element);
}
tree.getRootItem().add(item);
If the isOrDecendantSelected(null, element) returns false, the item remains null and a NullPointerException is thrown if added to the root item. The bug can be fixed by only adding items which are not null: if (item!=null) tree.getRootItem().add(item);
- When entering a filter string, no items (even those, that match the query string) are displayed anymore. When removing the query string, the Tree remains empty and is not rebuild at all.
Can anyone reproduce the described behaviour, or help to fix the problems?
Regards,
Dany