Hi,
I've a tree that loads on demand its data. When a user selects one folder, it can open a window and operate with it. This window needs to know the folder's children.
If you invoke a Tree.openFolder() it's asynchronous, so in code like this:
tree.openFolder()
window.show()
You will end up with the window being show before the tree folder is loaded.
On the other hand, if you add a:
tree.addDataChangedHandler()
to get notified when the data changes, it's not a clean way to do this.
Anyway, opening the folder is a side effect: before showing the window the only thing I need to do is to load the folder children in the model, not to open that folder.
Do you know any clean solution for this?
Thanks in advance,
Juan
I've a tree that loads on demand its data. When a user selects one folder, it can open a window and operate with it. This window needs to know the folder's children.
If you invoke a Tree.openFolder() it's asynchronous, so in code like this:
tree.openFolder()
window.show()
You will end up with the window being show before the tree folder is loaded.
On the other hand, if you add a:
tree.addDataChangedHandler()
to get notified when the data changes, it's not a clean way to do this.
Anyway, opening the folder is a side effect: before showing the window the only thing I need to do is to load the folder children in the model, not to open that folder.
Do you know any clean solution for this?
Thanks in advance,
Juan
Comment