-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello all,
I can't find out how to refresh a tree correctly (the whole tree, from within the java composer class).
I have different icons (traffic light style) in the tree and need to update all of them without changing the structure or display of the tree.
I tried the TreeDataEvents with this code
wsModel.fireEvent(wsModel.getRoot(),0,0,TreeDataEvent.CONTENTS_CHANGED);
TreeDataEvent.CONTENTS_CHANGED - nothing happens
TreeDataEvent.STRUCTURE_CHANGED - updates the icons, but the tree collapses, selection is lost
TreeDataEvent.INTERVAL_ADDED - first node gets duplicated
TreeDataEvent.INTERVAL_REMOVED - first node disappears
Maybe the problem is the range of the elements that receive the event: with
wsModel.fireEvent(wsModel.getRoot(),0,7,TreeDataEvent.CONTENTS_CHANGED);
Is there a way to refresh the whole tree, without firing the ON_CLICK Events?
Thanks,
F. Schuster
Hi,
Could you provide a sample that can reproduce this issue?
For example, I do not understand what the icons are.
Maybe they are the Image Component in the tree?
Or a style with background-image?
Regards,
Ben
if you wanna keep the tree structure open and refresh the contents of a single node, use
fireEvent(node, 0, getChildCount(node- 1, TreeDataEvent.INTERVAL_REMOVED); fireEvent(node, 0, getChildCount(node - 1, TreeDataEvent.INTERVAL_ADDED);
Asked: 2012-03-15 08:11:36 +0800
Seen: 260 times
Last updated: Jun 15 '12