The code to prevent changes from being lost does not
work in combination with a tree when a change on page
x, object y is made and then object z that uses the
same page x is clicked in the tree. What happens is that
the changes are saved to object z instead of y.The
problem is caused by the fact that the load of a page
happens before the unload is complete. Since both
pages share the same bean the changes are saved to
the last bean!