Revision history [back]

click to hide/show revision 1
initial version

asked 2013-02-22 11:32:46 +0800

avidD gravatar image avidD

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: image description 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: image description 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: image description 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: image description 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
Learn More