When using bridge to change a Node, you have to call node.commit() after the
changes. It's however hard to know to when that is needed, if you are trying
to wrap the Node object, in something else like taglib.

In taglib's 'node-provider' it is administrated seperatedly now if the
node object has been modified. If so, in the doEndTag node.commit can be
called.

This works with tags like 'mm:setfield' which say to their node-tag that
they are modifying the node.

Now, however we have the function tags, and it gets a bit more tricky,
because those too can modify the node.

The BasicNode implementation of Node already has a 'changed' member, so it
would be simple enough to add a 'isModified' or 'isChanged' method or so to
the Node interface.

Another possible solution is wrapping the complete node, in an object that
detects changes also, but that is quite cumbersome because Node has already
65 methods or so. But we don't have to add yet another one, then.

The last solution i  could come up with is changing the commit()
implementation of Node, making it do nothing if the node was not changed, in
which case you can in taglib simply commit the node always to be on the safe
side.


Any ideas?


-- 
Michiel Meeuwissen
Mediacentrum 140 H'sum 
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
 [] ()

Reply via email to