Sean Schofield wrote:

Adrien,

I can't help you with this question (yet) because I am still
researching how tree works now.  I am going to be working on a
significant changes to tree very soon though and this is something
that I've been wondering about myself.  (BTW, you can see recent
thread about some of the improvements being considered - we'd love to
get feedback from a current tree user.)

Anyways, I don't really understand why these interface methods (such
as nodesWereRemoved) are even needed. Why should the model notify the
tree that it has changed? Its not like you can "push" the updated
tree to the user. You still have to wait for the user to request the
page again, so why not make the model ignorant of the tree and just
re-render the tree according to whatever the model is at the time?


Well, again all the listener stuff was inspired by the swing tree component. Consider there is one central tree model on server side and there are lots of clients working on that tree. Each client holds it's own state of expanded/collapsed nodes and stuff like that. In case the tree is large and you have lots of nodes expanded in your client, you would have to check for any node displayed if the node still exists in the model, if the node has moved or if it's label has changed. It's faster to collect and handle events on model changes instead.

You are right that there is no push of modifications to the client, but for any active tree all model events are collected in a queue and on the next tree-related faces request all the model events in the queue will be handled before the current faces request will start. This way all the trees stay synchronized with the model, not always on client side of course (no direct change notification from server to the client), but on server side.

Oliver

I'm very interested in knowing why this functionality is needed
because I'd like to simplify things by removing it in the new version.


sean


On Mon, 31 Jan 2005 18:16:00 +0100, Adrien FOURES <[EMAIL PROTECTED]> wrote:


Hello

I used the 1.0.8 x:tree version, and i wanted to know what i have to do,
to look change in tree after inserted or removed a node in structure.

Which function use and how use it? nodesWereRemoved (i have got an
exception), nodesWereInserted (i have got an exception),
nodeStructureChanged (i have got interface bug -> all my tree node are
collapsed) .

Thanks a lot for your reply
Adrien





--
Oliver Rossmueller
Software Engineer and IT-Consultant
Hamburg, Germany
http://www.rossmueller.com



Reply via email to