Monday, November 26, 2012

jQuery dynatree adapter for JSF 2


dynatree-for-jsf is a JSF 2 adapter for dynatree jQuery plugin ( dynatree allows to dynamically create html tree view controls using JavaScript.

Why this adapter though Richfaces or Primefaces already implements> tree components ? Because dynatree has more features, is more mature, robust and is a prooven component.

Source code and sample are available on 
Sample is running on Cloudbees at


This adapter handles events for all of the dynatree events. All events can be mapped to JSF ajax events.
Here is a typical use of the adapter

onLazyRead and onActivate ajax events are binded to methods of the managed bean treeBean.
  • lazyRead populates the tree dynamicaly.
  • activate refresh a JSF panel with the selected node key.
All with Ajax.
This project does not include jquery, nor dynatree. You should include their by yourself.


I have create an example with an infinite ajax tree
Browse to http://localhost:8080/tree/tree.jsf
alt Screenshot


Apache License, Version 2.0



Authors of dynatree, a great component. Authors of Primefaces and Mojarra, a source of inspiration on how to create an JSF 2 component with Ajax behaviour


  1. Are you sure that is an accurate representation of your code? I just set this up on jsFiddle, and can select upwards of 62k nodes in chrome in under a second. Upwards of that and Dynatree throws a RangeError exception. Dmtech

  2. This is really a great post. Thank you for taking time to provide us some of the useful and exclusive information with us. Keep on blogging!!
    Android Training in Chennai Thiruvanmiyur

  3. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

    PPC Services in Chennai

  4. Wow amazing i saw the article with execution models you had posted. It was such informative. Really its a wonderful article. Thank you for sharing and please keep update like this type of article because i want to learn more relevant to this topic.

    Digital Marketing For Small Business in Chennai

  5. Superb i really enjoyed very much with this article here. Really its a amazing article i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your updation.
    Digital Marketing
    Company in Chennai