ICQ:53-755-182 RSS channel for codegravity.com homepage Bookmark!

61/2NEW projects | 14 businesses NEW! | 258 web resources | 179/6NEW freelancers | 494 topics


JoomlaWatch
JoomlaWatch Stats 1.2.6 by Matej Koval
We have 6 guests online


Login form:





Lost Password?
Register
Partners:

Google Page Rank Checker

My CV / resume

WinAsm Studio

Prehliadac Opera

ColdFusion, Flex, PHP Web development worldwide

View a profile on proagora.com
view my profile

CodeGravity.com is
looking for the
link partnership
with related websites.

Relax, oddych, zabava, ubytovanie

Ubytovani, volny cas, zabava

Vyšné Ružbachy

Reštaurovanie, kameň, bronz, drevo

Slobodne forum

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:
rss feed
Home

JSF, Icefaces and custom components experiences

Sponsored links:

I got the task to evaluate the new web-frameworks in the company I work for.  There were many candicates that might enhance the web user interface and move away from the old struts framework. If you want to know some of my experiences, just read on..


Google web toolkit ? 

One of them was google web toolkit. I have to say that the development in GWT is quite simple, but there are many other problems there. One of the main cons was, that it's still a javascript that has to be deployed in the production. The gwt produces also different versions for different browsers, so when something goes wrong, you have to be a multi-browser javascript expert.

Trying JSF

I had some JSF experiences before, but since that time many things have changed. Today there is a whole variety of 'rich' components and frameworks that provide much better user experience than the old plain JSF HTML renderer.

Icefaces is one of the solution that combines both.  It lets you to use the power of JSF and the AJAX together.

Good thing here is, that you don't have to write a single piece of javascript code. All AJAX magic is made by the Icefaces' AJAX bridge. It's really amazing  how also the old  components are  rendered without any page refresh ! 

AJAX bridge works that way, that it partially updates only the part of the application that has changed.

There are also some other amazing features like the partial form submission (validates your form right after you fill the value in the input field).  

Another neat feature - Validators

You can attach to eg. input field any kind of validator you want. There are some pre-defined, like LengthValidator, DoubleRangeValidator, etc.. And if it's not enough, you can write your own.

I saw some custom validators around the internet - eg. the regular expression validator, and many others.

 

What about custom components?

Even though you are using many of components that comes with the icefaces framework and the JSF, it may happen that you will need to write your own component.

It took me some time to get into it, but after that I must say that it's quite easy. You can generate the forms, form fields, panel grids, data tables, etc.. on the fly ! This is the most powerful feature. This way you can have the component that is absolutelly dynamic.

Unfortunatelly, in every tutorial I read, renderers are using the HTML-like way to produce the component's output. You had to be the one who writes the HTML tags, but this is not a good idea. For those things we had JSP and other 'low-level' web languages.

I found a way how to use existing components and render them dynamically.
All you have to do is just to find a blank custom tag by it's component id and then add all the instances of components you want there. The component abstraction is great. You don't have to care about some output. The style is quite simmilar to the swing-kind of programming.

You can react to the user interaction with methods like onClick, onChange..  There are some effects as well. This way you can make your form to 'Appear', fade in, fade out.. 

 

Myfaces and tomahawk components

Icefaces provide their own set of rich components, which you can see at

http://component-showcase.icefaces.org/component-showcase/

 

but..  I tried to switch the SUN JSF Reference Implementation (RI) for a MyFaces JSF implementation. The switch was without any problem, you just remove the sun's JSF jars and put the MyFaces .jars there. Myfaces have also better error reporting mechanism, and you directly know what's going on..

I haven't tried the JSF 1.2 yet (it's the new implementation). 1.1 was fine for me, also because it's stable and people have experiences with that.

So.. when I had my web application working on myfaces, I tried to use some of the tomahawk components. Here's the link where you can find them:

http://www.irian.at/myfaces/home.jsf

Things like callendar, sortable table and other are perfect. There is also a possibility to use the Myfaces Sandbox components. It's the bunch of components "waiting" to get into a set of Tomahawk components. I haven't tried those components with my application yet. 

But, the great thing is, that you can use both - icefaces and tomahawk components together.  Sometimes I experienced some rendering problems, but I thing it's solvable.

 

What IDE to choose?

I downloaded a BEA Workshop for JSF, which is a great eclipse-based IDE, but unfortunatelly it's not free. There is a trial version, but after some days you don't have any chance to use this IDE any longer.

I found the solution - there is also a free version but only for JSP. It's called "BEA Workshop for JSP". It doesn't provide as much features as BEA Workshop for JSF, but I'm fine with it. I can live without features like showing you available parameters in the JSF tags, and so on.

Main reason why I use this IDE is that it redeploys your web application automatically. This way you don't have make the process "stop, build, run" manually everytime you make some single change.

 

Conclusion 

Icefaces seems to be the best solution when you want the rich user experience, easiness of use and good code maintability. You can separate the work between the component developer and the web designer and it allows you to use all of the existing libraries and the power of java.

 





Sponsored links:

Comments (4)
RSS comments
1. 30-01-2008 11:58
A question on JSF custom control impleme
Dear Sir, 
 
 
 
I have just read your article and wonder if you could kindly help clarify the idea… 
 
 
 
http://www.codegravity.com/programming/jsf-icefaces-and-custom-components-experiences 
 
 
 
Unfortunatelly, in every tutorial I read, renderers are using the HTML-like way to produce the component's output. You had to be the one who writes the HTML tags, but this is not a good idea. For those things we had JSP and other 'low-level' web languages. 
 
I found a way how to use existing components and render them dynamically. 
All you have to do is just to find a blank custom tag by it's component id and then add all the instances of components you want there. The component abstraction is great. You don't have to care about some output. The style is quite simmilar to the swing-kind of programming. 
 
 
 
What exactly do you mean by “add all the instances of components you want there”. Which method of the UIComponentBase class is used? A short code snippet will definitely help… 
 
 
 
Anyway, any help will be greatly appreciated! 
 
 
 
Regards, 
 
Kirill
Written by Kirill (Guest)
2. 30-01-2008 12:00
Re:
Hi Kirill, 
yes, I also found a way how just to assemble a component tree without any need to write HTML tags. And of course, this is the way how we should work with JSF, on this level. 
 
I'm doing it like this, that a particular JSF tag is bound to the private instance of a backing bean using a tag binding="#{backingBean.form}" . This instance then can be manipulated using for example 
HtmlOutputText text = new HtmlOutputText(); 
text.setWhatever..(); 
 
form.add(text); 
 
in methods of a backing bean, 
 
and in the view, the form (and it's children, in this case - the text) is iteratively rendered by their own renderers. 
 
 
I think your approach is pretty much the same, right? 
 
Regards, 
 
Matej Koval
Written by Matto (Guest)
3. 30-01-2008 12:01
Re:
Hi Matej, 
 
 
 
Thanks much for you quick response… it was very useful! 
 
I just tried the idea on my project and it worked fine. 
 
 
 
Seems like one can inherit a component from HtmlPanelGroup and not to implement the encodeBegin, encodeEnd to do some low level HTML rendering which is devious and error prone process. 
 
 
 
Thanks gain, 
 
Kirill
Written by Kirill (Guest)
4. 27-03-2008 06:50
hi
hi 
 
i want to ask a question, how to integrate struts2 and icefaces? 
thanks a lot  
 
come from china
Written by This e-mail address is being protected from spam bots, you need JavaScript enabled to view it (Guest)

Write Comment
Name:
E-mail
Homepage
Title:
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:



I wish to be contacted by email regarding additional comments
MathGuard security question, please solve:

1QF         T9L      
  6    M    D K   2CT
E45   6B4   HTI      
  R    N      B   DR7
NXX         UOL      

Powered by AkoComment Tweaked Special Edition v.1.4.6
AkoComment © Copyright 2004 by Arthur Konze - www.mamboportal.com
All right reserved

Icefaces custom tag with facelets>
 











Download the NEW JoomlaWatch 1.2.5 from 24.3.2008 that works with Joomla 1.5 and Joomla 1.0

Sponsored:



Popular:
MathGuard
Random screenshot:

l3d04s.jpg


Poll
JoomlaWatch 1.2.5 installation was for me
 

News:

Registration required
I know that people don't like registering on websites, but I had to do it. From this moment you have to register first, before you download any file. This is better, because this way I can give you quick info about new version of downloadable files (eg. MathGuard) or some necessary security fixes. Thanks for understanding. (26.08.2007)

Books about investing and finance
I'd like to recommend you to read a book by Robert T. Kiyosaki - "Rich Dad, Poor Dad". However many people say it's quite a controversial book, it gave me a good motivation to improve my financial intelligence. (23.08.2007)

Fighting with the spam
All of the forms were protected with my own PHP antispam class - MathGuard, including the forms in the joomla modules I use. (02.05.2007)

Forum
Converted posts from the old punbb forum to the new joomlaboard (25.02.2007)

Improvement
Fixed some issues with the freelance registration, added a possibility to add a new programming resource, reorganized the structure of the programming resources. (24.02.2007)

New content management system
Codegravity.com is now running on joomla cms :) Added features like comments, forum etc. I hope you'll like it. Today I fixed the problem with the comment module which was not showing the correct images. There is also a new URL structure. For the old urls there is a 301 (Moved permanently) http redirect. (10.02.2007)

Moved to another hosting
Codegravity.com has been moved to another web hosting - CustomHosting.sk, from the previous pipni.cz, mainly because of the mod_rewrite problems and slow loading of the website. Sorry for some problems that lasted for about an hour. (19.01.2007)

Bookmark feed
The new feed from the del.icio.us has been added to the homepage codegravity.com. You 'll always have the latest information about the sites I like and you should visit as well! (21.11.2006)

News improved
Today I improved the news feeds. They are sorted into categories and I also added some other feeds that may be interested for you. (31.03.2006)

The Antispam verification
My email form was hijacked by the spam bots and I was recieving a lots of junk into my mailbox everyday. So, I decided to put a simple verification in the end of the form. You have to answer the result of addition of two numbers. Thank you for your understanding. (07.03.2006)

Java SE 6 Beta Mustang is out !
This beta release is a major milestone in the development of Mustang. It provides a complete stable snapshot of the final release functionality. http://mustang.dev.java.net (20.02.2006)

Google analytics, apply online
Apply online to google-analytics.com. They offer the new way of analysis of your website visitors. It is very promising, and when you will recieve the invitation code, you can send me one :) Thank you :) (13.02.2006)

Money Manager 2 - software for mobile accounting

FaceRSS - simple JavaServer Facer (JSF) component
I registered my new project - FaceRSS on freshmeat.net, here is the description: FaceRSS is a simple JavaServer Faces (JSF) component that allows you to display news from a specified URL source in one configurable JSP tag. This allows you to place news feeds on a Web site in a very simple way. It uses rsslib4j and therefore supports RSS version 0.9x, 1.0, and 2.0 with Dublin Core and Syndication namespaces. (06.01.2006)

My new blog :)
Check out my new [jroller.com/page/matto3c] blog on jroller.com website. Here is the RSS feed [http://jroller.com/rss/matto3c] if you'd like to add it into your news reader. (14.12.2005)

ERM-II and Slovakia
SLOVAKIA, my home country, is now one step closer to adopting the common European currency - EURO. At midnight between November 25 and November 26, the country joined the Exchange Rate Mechanism 2 (ERM-II) (30.11.2005)

www.jground.com
I established a new website - http://www.jground.com, it's all based on JSF and it should be all about Java and all other related things. Enjoy! (25.11.2005)

Swing text antialiasing

Java webhosting
I'm trying a new http://www.move.cz java webhosting on www.move.cz, but it seems they don't respond to my questions about JSF ;( (16.11.2005)

Migration from Weblogic to JBoss
Currently I am working on a task: Migration of one J2EE application from Weblogic to JBoss application server. So, if you have any suggestions or resources, I would be glad if you'll send me some. Thanks (15.11.2005)

Increased Java performance
Java increased its performance on desktop by 58% : [http://www.javalobby.org/java/forums/t54006.html] Java Performance
Improvement (15.11.2005)

Exadel Studio Pro
At this time I'm playing with JSF (Java Server Faces). I want to recommend you a great IDE - Exadel JSF Studio Pro. It costs about $99, and there is 15 days trial available. You can also try MyEclipse which has also like Exadel - WYSIWYG editor for editing JSP, JSF pages. It can save you a lot of time. For more info, visit www.exadel.com (27.09.2005)

Programming directory
added a new programming resources directory, where you can submit your own programming website (14.09.2005)

Programming forum
Now the Programming forum is included in website design. I put there some topics from previous version of this forum. (19.08.2005)

Ubytovanie, podnajom Poprad
Ponuka na podnajom, ubytovanie: Zrekonštruované podkrovie - rodinny dom Poprad-Matejovce - 2 izby + pracovna + kúpelna s kuchynou, strešné a plastové okná, samostatné plynové kúrenie, drevené plávajúce podlahy, garáž, velká záhrada a samostatný vchod. . . Cena: dohodou
Kontakt: 0949 401 409 (18.02.2008)
Privacy policy | freelance programmers | webmaster resources | business directory | advertise with codegravity.com

Locations of visitors to this page


©2003-2007 Codegravity.com - JSF, Icefaces and custom components experiences