5 Replies Latest reply on Sep 11, 2008 2:22 PM by Mike Hanafey

    Is it valid to include a tree inside of another tree?

    Mike Hanafey Newbie

      I have situation where there is an outer tree whose nodes have an inner tree. Specifically, the outer tree is over DNA sequences, and each DNA sequence may have a tree of comments attached to it.

      Both the inner and outer trees have a couple of faces, one is used when a node is in display mode, and the other when it is in edit mode.

      If the inner tree is put into edit mode at a node (via an ajax request) and a validation error occurs on a second ajax request to submit the edits, the whole inner tree for that node disappears. It can be recovered by doing a browser redisplay. If there is no validation error, the edit works as expected, except now the collapse / expand behaviour on the inner tree is lost.

      Looking at the XmlHttpRequest response when there is a validation error shows that the response does not contain the expected tree nodes.

      When this same comment tree code (both the backing beans and the facelets views) is applied on an unnested tree this problem does not occur.

      So the question is, is it valid to include second tree in the nodes of an outer tree?