jump to navigation

JSF and IceFaces April 4, 2008

Posted by Phill in Frameworks.
Tags: , ,
trackback

I mentioned a couple of posts ago that I was trying out Google Web Toolkit. Well, I’ve come to the conclusion that Google Web Toolkit is not the right solution for this particular project.

The problem was mainly one of scope: I think GWT, due to the way it’s designed, is more for small-to-medium size projects at the moment. The project which I am currently working on is small at the moment, but we will need to integrate various other things with it in the future and it will grow.

I did look at Echo2 as well (thanks to Dalibor for pointing it out to me), and that does look good – more like it would be able to handle larger applications, due to the way the page is loaded – but I don’t think it’s exactly what we need at the moment either.

What we have done is use JSF with IceFaces. IceFaces is a “Web 2.0” framework for JSF, i.e. it provides a set of JSF components which are AJAX-enabled. It was a bit of a struggle to get working with Tomcat 6.0, but I got there in the end!

Anyway, I’ve been using it for a couple of days now and I really like it. The AJAX is handled completely transparently to you – you just design your JSF application as you would do normally, and IceFaces will handle the AJAX. As an example, it’s really this simple to add an AJAX based table to your JSF page:

1. Use an IceFaces “dataTable” component
2. Have an IceFaces commandButton call the backing bean to populate the table with data (for example, search results)
3. The data table is updated automatically without needing a page refresh
4. …
5. PROFIT!

    Ok, I admit it, items 4 and 5 are not part of it. But still, I think it’s pretty good going.

    There is a bit of configuration to do before you start, but then that’s the same with pretty much any framework I know!

    What I’m trying to do at the moment is set up a “Loading” message, i.e. when you click on a button which will execute a long operation (for example, doing a text comparison on a lot of database fields) a loading message will be shown. By default no message is shown, and I can’t find a way of automatically displaying one for every call (ala DWR).

    Advertisements

    Comments

    1. Neil Griffin - April 5, 2008

    You can do progress updates for a long running operation using ICEfaces Ajax-Push (server-initiated rendering). I’ve done this type of thing within Liferay Portal, in the sample-jsf-1.1-icefaces-portlet that has a progress indicator on a file upload.

    2. J - May 14, 2008

    If you could consider going away from the page based programming and to swing-like java coding without any further configuration, then have a look att IT Mill Toolkit.

    3. Domiac - June 14, 2008

    IT Mill Toolkit is excellent solution for larger applications, you might also consider Echo or even Thinwire too.

    4. Rahul Juneja - September 19, 2008

    Phil,

    We are trying to setup and application with JSF-RI and icefaces 1.7.1 with Tomcat6 and for some reason the commandlinks when clicked doesn’t render the page and when i turned on the log for icefaces i could see that the rederview method does get called and the page is not refreshed.

    hope you can give me some pointers.

    Thanks,
    Rahul

    5. Phill - September 19, 2008

    Hi Rahul
    It’s probably best to post your question on the IceFaces forums – they’re pretty good there: http://www.icefaces.org/JForum/forums/list.page
    Thanks,
    Phill

    6. priyantha - November 12, 2008

    Hello,

    i am new to java/jsf web programing, & also i have done a small program to read,write & print data using the jsf forms & mysql. now i need this application to work as an ajax application without
    the forms being re-freshed, pls. instruct me how to intergrate icefaces in to my project.
    Thanks, Priyantha

    7. cagataycivici - May 21, 2009

    Being completely abstracted from the ajax, request&response takes the control from you in your own application all together and I believe it causes more problems than it solves. As a JSF developer you alredy don’t have full control of what’s rendered on the page, with the icefaces approach it goes one step further and you lost the control about what’s going on in the page. It’s not surprising that JSF 2.0’s builtin ajax is based on a different idea. Just my 2 cents.

    8. Phill - May 21, 2009

    To be fair though, it’s pretty rare that I come across a situation where the IceFaces built-in AJAX has limited me.

    9. Rainer Eschen - July 30, 2009

    @Phill Absolutely. The abstraction is one of ICEfaces strength. The other one is AJAX Push. I did a lot of extra coding (after two years of development in our project) for my ICEfaces book and I have to salute Ted and the other guys for this work. There’s already a part of the sample source code available:

    http://icefusion.googlecode.com/

    For more details about the book:

    http://blog.rainer.eschen.name/icefaces/

    10. Steffen Schuler - December 4, 2009

    IceFaces has a lot of unsolved issues… the AjaxPush stuff works pretty well, and especially the different kinds of Renderers like the OnDemandRenderer or the IntervalRenderer do work very well. But the components are not well designed. It seems like they are trying to fix all the JS-flaws in an IceFaces way (fix it on demand : ) instead of relaying on a solid JS-Framework (e.g. JQuery) that actually does the tricky parts. After 12 month and a lot of issues later, I would never ever use this IceFaces again. Pain has a name – IceFaces.

    11. Phill - December 4, 2009

    Steffen, that’s not been my experience with IceFaces. There are reasons I would think twice about using it in my next project, but that’s mainly due to JSF – not IceFaces. JSF 1.x is basically crazy. I think JSF 2.x has fixed many of those problems, but I’d have to see it in use for a while before adopting it.


    Sorry comments are closed for this entry

    %d bloggers like this: