Sunday, July 4, 2010

icefaces without icefaces

First thing you think when starting with JSF is how to customize look and feel and add some javascript. JSF itself is not friendly to CSS and Javascript,
for number of reasons:
  • ids of elements are dynamic, so your script will have difficulties to find it.
  • components hide actual html  from you, you discover it after page is rendered
  • css styles are not 'visible' to programmer.
  • actual html parts of a component are almost impossible to change.
Adding ajax  to jsf page is not an easy task. Defining ajax on component level makes your view depends on too many javascripts and you model becames ajax-depended and not-testable.

Icefaces comes with great solution to ajax. It comes with tons of components, which are great but still difficult to change. For example, tab container render tabs with 'table-tr-td' and quite limited in terms of customization.

I believe in another approach. Instead of using complex jsf components, write FACELETS.
Reuse your html parts, especially if your skill CSS skills concentrated in hands of one person.
Sure, simple components like h:inputText are perfectly ok.

Complex components like tabs, tables, trees, menues, popups all can be done in css-html.
Turn your html into facelets, create tag library for you facelets and you will benefit from flexibility in long run.

So if Icefaces's components are not suit you, still do use Icefaces.... without its component.
95% of Icefaces is its AJAX engine. 4% is Push mechanizm.

When you have free hands to html-design, JSF became your friend forever.

Saturday, June 26, 2010

Why and when use ICEFACES?

Icefaces is a great(best?) JSF library. Its great mostly becouse it make AJAX easy to use. Its so easy that you even should not know about AJAX at all.

You can do almost everything with ICEFACES. All you can do with html, javascript, you can do with ICEFACES.

Its good for most business application.

And as we said, its limitation are the same as HTML-CSS-JAVASCRIPT. In short, its not applet, flex,flash, javafx.

If your primary skills are JAVA, your markup language is HTML, and you must use AJAX in every place in you application, ICEFACES is the best choice.

If you need "PUSH" capabilities, ICEFACES will do it in simple but efficient way.

You want create your components? No problemo with ICEFACES.

Icefaces comes with number of components. But its real value is AJAX engine. Every component you will create will be AJAX enabled. Cool!

ICEFACES supports facelets. So its easy to reuse you html code.

First steps with jsf and java

Creating dynamic web application is eazy. You will need some basic java skills and some knowledge about HTML.

First, download some java development enviroment, Eclipse is free and good.

Then dowload ICEFACES jsf library.

Follow the instruction how to install it.

Download and install some java application server, Tomcat 6 is ok.