Monday, November 26, 2012

jQuery dynatree adapter for JSF 2

Introduction

dynatree-for-jsf is a JSF 2 adapter for dynatree jQuery plugin (http://code.google.com/p/dynatree/). 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 https://github.com/nithril/dynatree-for-jsf 
Sample is running on Cloudbees at http://dynatree.nithril.cloudbees.net/tree.jsf

Features

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.

Example

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


Licenses

Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0

 


Credits

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

5 comments:

  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete