This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create a tree component in JSF

 
Rajesh Naidu G
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am using JSF with Facelets with Spring web-flow.I want to create a tree which is equivalent to ICEFaces' <ice:tree> .I don't want to use ICEFaces. Please help me to solve this.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greeenhorn! Welcome to the ranch. And that's a great question - not an uncommon one.

So, you have a design that you want, and it's a design that largely relies on JavaScript, correct? I mean, all of those trees that expand and contract are largely JavaScript running on the client machine, with the occassional call back to the server.

How are you going to do it? Well, as you mentioned, many JSF extensions like IceFaces provide that type of functionality. But you don't want to use IceFaces, which is understandable. But, you still need that functionality! Well, you're going to have to write it yourself, and perhaps put the code in your own custom tag - essentially, you'll write your own component that is very similar to the IceFaces one. I mean, how else could you really do it.

You can get the source for IceFaces. If you're looking to roll your own, you may as well leverage what people much better looking than you and me have already coded and tested. But really, if you're not going to use a third-pary library, well, then you'll have to write one on your own.

Keep posting question! And if I said something you disagree with, please challenge it. That way we all get the very best out of this message forum.

-Cameron McKenzie
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18009
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Funny you should ask. I'm looking at the source code of the RichFaces tree control right now.

RichFaces has a very nice development kit with a decent manual to tell how to use it. But custom JSF controls are not for the "All you have to do is/Git 'R Dun" crowd. Even "simple" JSF controls can be pretty complicated and nasty, and if you want the level of interactivity that you'd get from JavaScript support....

Let's put it this way. I've done custom JSF controls before. I'm subclassing a control that's mostly already complete - it's mainly just a matter of changing the look and feel.

I doubt I'll get it "Dun" in less than a week.

Unless there's a really compelling reason, Don't Reinvent it Yourself (DRY).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic