This post is an addon to my previous post: Customizing APEX trees.
The previous post was pretty much complete EXCEPT (offcourse there's an exception) for the cases when the user was expanding or collapsing the tree !
To interfere with the process of expanding or collapsing the tree (we will generically define this as drilling from now on in this page) we need to take a look in the tree definition page at the Dynamic templates section.
We can find there, this tiny piece of info that looks like:
This is where the linking is made, and the #DRILL_DOWN# string contains everything we need: the method (expand or contract) and the node id that has to be applied that method.
Instead of the above, we can therefore have something like:
And in the treeDrilling we can easily redo everything we have done in the previous tutorial with the persistFormData function ...
Maybe the only thing that one may note there is the format of the #DRILL_DOWN# string, which is obviously a link like:
The expand and contract commands are given inside the APEX link, just after the session id, AND we can still append to the above the values of our form data !!
Once again - I hope this helps !