# Revision history [back]

### Strange behavior of CONTENTS_CHANGED for tree view updates

Hi, we have several nested trees displaying different types of objects. Clicking on a tree item opens a form to edit the item. When the form is saved the content of the tree which is still displayed on the left hand side is updated. In this situation we have a strange behavior, namely, tree items change position in the view. This is the situation we have before the update: the user has selected the node ff and will now change the name of the node On changing the value of the node we issue the following event to ZK:

mModel.fireEvent(
TreeDataEvent.CONTENTS_CHANGED,        // event type
new int[] { },                         // path to parent
1,                                     // from
1);                                    // to


Now this is the situation we have after zk handled the event: The child of bb is now displayed under ff. Also collapsing bb will now ("correctly") remove cc from the view, expanding ff has no effect.

This seems very very strange. Has anyone run into this before?

Cheers, David

### Strange behavior of CONTENTS_CHANGED for tree view updates

Hi, we have several nested trees displaying different types of objects. Clicking on a tree item opens a form to edit the item. When the form is saved the content of the tree which is still displayed on the left hand side is updated. In this situation we have a strange behavior, namely, tree items change position in the view. This is the situation we have before the update: the user has selected the node ff and will now change the name of the node On changing the value of the node we issue the following event to ZK:

mModel.fireEvent(
TreeDataEvent.CONTENTS_CHANGED,        // event type
new int[] { },                         // path to parent
1,                                     // from
1);                                    // to


Now this is the situation we have after zk handled the event: The child of bb is now displayed under ff. Also collapsing bb will now ("correctly") remove cc from the view, expanding ff has no effect.

This seems very very strange. Has anyone run into this before?

The view is correct if I call invalidate() on the tree at once after issueing the event. This, however, seems a bit expensive as our trees contain thousands of nodes and this is acually against the idea of AJAX to update only what has changed, right?

Cheers, David

Support Options
• Email Support
• Training
• Consulting
• Outsourcing