JSF MyFaces tree2 component usage

There were mutltiple challenges in creating a tree view for the organisation hierarchy that we needed. As we were using JSF-myfaces so the obvious choice of the component was myfaces tree2 component.

Firstly, on the startup time, I needed to load the tree with all the root level of organisations;
secondly, on the clicking on the node, its suborganisations were supposed to be loaded and the page on the right side of separator must also be directed towards “Subordinate Organizations” page;
thirdly, on the click of the suborganizations at the right side of the separator the tree must be properly updated with its children;
fourthly, on second time click of the selected node, its edit profile page must be opened;
lastly, all the cosmetics like bold font for selected node, auto expansion after step 2 returns the response and different icons usage for different types of organisations etc.

Lets see how we met these challenges. NOT to forget that we took 2 honest weeks to finish off this thing:

Continue reading