0

How refresh tree without changing structure?

asked 2012-03-15 08:11:36 +0800

schustf1 gravatar image schustf1
129

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);

something happens, but it is not quite what I want: the ON_CLICK-Events are fired.

Is there a way to refresh the whole tree, without firing the ON_CLICK Events?

Thanks,
F. Schuster

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2012-03-19 10:09:30 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

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

link publish delete flag offensive edit

answered 2012-06-06 11:27:51 +0800

creata87 gravatar image creata87
197 2

..neata :p

did you happen to find how to refresh the tree from the composer without changing the structure of the tree? :)

link publish delete flag offensive edit

answered 2012-06-15 11:08:22 +0800

creata87 gravatar image creata87
197 2

..any ideas? please.

link publish delete flag offensive edit

answered 2012-06-15 12:30:06 +0800

creata87 gravatar image creata87
197 2

updated 2012-06-15 12:30:19 +0800

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);

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-03-15 08:11:36 +0800

Seen: 260 times

Last updated: Jun 15 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More