Register | Log in | RSS channel for codegravity.com homepage Bookmark!

284/2NEW projects | 71 services | 215 websites | 834/3NEW freelancers | 2126 topics | advertise



Login:



Forgot your password?
Forgot your username?
Create an account
JoomlaWatch Agent

Users

Most active users today from total of 108:
garikello, Peerke, jakkrit, dayanand, andrew_saber, giakhanh, mohalb, carmachhh, fguyon, dfireablaze, boho, phoeker, ozedfr, ashish_php, amoluca, blackie, JDev, tinytim007, Pascale, besoil


19.9%United States United States
17.9%India India
9.3%Germany Germany
5.5%Russian Federation Russian Federation
4.4%United Kingdom United Kingdom
4.3%France France
4%Australia Australia
3.8%Netherlands Netherlands
3.8%Poland Poland
3.7%Italy Italy

Today: 953
Yesterday: 1402
This Week: 5243
Last Week: 8869
This Month: 2355
Last Month: 37593
Total: 117035


Partners:

HTML5, CSS3, SVG, tutorials

Freelance ColdFusion, Flex, PHP

Olejomalby, abstraktne obrazy

Camping Europe

WinAsm Studio

Vyšné Ružbachy

Sochy, Reštaurovanie

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:

Statistics:
Search Engine Genie Promotion Widget
Home

Icefaces custom tag with facelets

I've been struggling with creating my own icefaces tag that I could use everywhere it's needed. There are many tutorials on the internet, BUT.. I couldn't get it work anyway.

When I looked at the sourcecode on the webpage, the tag     <ticker:ticker />  was there directly in the HTML sourcecode. This is wrong, because I expected the rendered ouput there.

One whole week I tried to solve this problem trying almost everything. But then, finally, I found it.

So, what was the problem? When you are using Facelets with your JSF/Icefaces, the TLD (tag library descriptor) files are for nothing. Even if I tried to place them everywhere. You have to create the equivalent of the TLD file for the Facelets - the XML file describing the tag structure. In this case it's ticker.taglib.xml

 

ticker.taglib.xml
The tag descriptor for the facelets

 

 There you specify the component's class - Ticker, and it's renderer - TickerRenderer. Now, you don't need the TickerTag as suggested when using JSP in many tutorials around the internet.


Also don't forget to tell the JSF to recognize your taglib and place this XML snippet into web.xml (just the first reference to xml, the second is when you want to use also another taglib - eg. the tomahawk components)
web.xml facelets libraries
Put the reference to your tag descriptor into web.xml

  

    <context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>
            /WEB-INF/ticker.taglib.xml;/WEB-INF/tomahawk.taglib.xml
        </param-value>
    </context-param>

 

  JSF source
JSF source with a custom tag



rendered output
Rendered output

 

I wonder why this 'trick' hasn't been described yet in some tutorial. So, I hope you will find this remark useful and it will help you when creating your own JSF components.

 

 

 

Comments  

 
0 #1 Jeff 2007-11-09 23:35
This was very helpful. Thanks so much for sharing this!!
Quote
 
 
0 #2 Tam 2008-05-23 23:10
Thanks for you answer. I was wondering if you can explain how to write the renderer for the class as most JSF custom components tutorials explain how to build a Tag file.
thanks
Quote
 
 
0 #3 michelle 2008-05-28 14:56
TLD's seem to be a major headache the only way we've been able to deploy icefaces custom components, we're working on our 3rd custom component is to include the tld, faces-config and the facelets tags in the icefaces-comp-jar itself. The other issue is its really a pain to create the necessary tag java module. On the bright side the api is very rich and coding icefaces components are easier than traditional jsf components.
Quote
 
 
0 #4 Java dev 2009-10-14 00:41
Thanks. This was great and very helpful!
Quote
 

Add comment


Security code
Refresh

No Tweets

Add URL of a programming website
register as a freelancer
submit your project
open freelance projects you can work on
webmaster resources
write paid blog posts about programming - tips and articles
bugs and features

Recommended: (advertise)
Download Joomlawatch 1.2.12


HostMonster.com -
best cheap Joomla Web hosting. Website joomlawatchdemo.com is hosted by them with domain for $6,95/mo.


Freelancers, create paid articles
-
Looking for freelancers with experiences in Java to write paid articles on their experiences

Green Geeks Hosting -
World's best selling green web hosting


Advertise Here
-
Promote your services and get the new customers from the community of webmasters / programmers visiting CodeGravity.com

Register as a Freelancer -
Submit your project experiences, programming languages and your other skills


Outsource your project
-
Submit your project description with all the requirements to more than 600 freelancers from around the world for FREE.

FastDomain.com -
Fast Domain hosting. Hostmonster alternative. Also for $6.95/month.



News from Twitter:
No Tweets
RSS Feeds:new

rss Freelance
rss Projects
rss Forum
rss Resources

Popular:
MathGuard
download mathguard
Random screenshot:

linoopz15.jpg


Poll

At what price would you purchase JoomlaWatch ad-free license?
 
Privacy policy | Advertise | Donate | Doucovanie Nemcina
Joomla Visitors Google Map
Loading map...
Joomla Visitors Google Map
Visitors Google Map Agent

Locations of visitors to this page


©2003-2010 Codegravity.com