X

Geertjan's Blog

  • May 3, 2008

RichFaces for NetBeans IDE 6.1 (Part 1)

Geertjan Wielenga
Product Manager
Yesterday I met with Wouter van Reeven, here in San Francisco, who mentioned the RichFaces framework to me. In particular, people in a JBoss-oriented world are likely to want to use RichFaces (as well as ICEfaces, Seam, and Facelets). For ICEfaces, a NetBeans plugin exists (here), though it works in 6.0 only. I've tried it, it's a pretty cool thing: you get support both for traditional web applications and for Visual Web applications. I'm hoping they'll upgrade to 6.1 soon (shouldn't be hard, I expect they only have a dependency change to fix).

However, no such thing exists for RichFaces. What's the difference between ICEfaces and RichFaces? No idea. Didn't know they existed until yesterday. However, they piqued my interest because of AJAX, which is a theme at NetBeans Day on Monday. So I created some basic NetBeans support for RichFaces, based on a cool and simple example application that Wouter sent me today. Go here to download the new support I created and then read on to learn about what it can do for you:

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=8934

Download that ZIP file, you will have two NBM files in the ZIP file, install them both in NetBeans IDE 6.1.

Now do the following:

  1. Create a new web application.

  2. Make sure to set GlassFish as your server, because this server bundles JSF libraries and RichFaces is an extension of JSF. If you want to use Tomcat or some other server, make sure JSF is available to the server in question.

  3. In the Frameworks panel, choose Java Server Faces AND RichFaces:

    Click Finish.

  4. Inspect the generated sources. In addition to your standard JSF application, you have the RichFaces JARs in the Libraries node, you have RichFaces entries in your web.xml, your welcomeJSF.jsp contains some RichFaces-specific code, and you have a managed JSF Java bean in a new package in your source structure, automatically registered in faces-config.xml. Here's the whole thing:

  5. Run the application and you have your first AJAX application via RichFaces:

    Notice that the text to the right of the field is automatically updated as you type in the field itself. That's AJAX, partial page refresh, faster response to the user, etc.

  6. Want to change the "skin" of the application? Drop this into the web.xml:

    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>blueSky</param-value>
    </context-param>

    Run the app again and notice the "skin" is different:


Now continue learning about RichFaces via online resources. Next, I will create a palette that provides items that you can drag and drop into a JSP page, for RichFaces. However, I doubt I will ever create RichFaces support for Visual Web applications, because that's an area I have little knowledge (nor very much interest) in. If someone wants to help me, such as in the area of Visual Web, feel free to leave a message here and let me know!

Join the discussion

Comments ( 17 )
  • Scoot Sunday, May 4, 2008

    Never heard of Richfaces :) it's marvellous! We use it almost by default along with Facelets, a rather nice combination. Nearly every JSF projects contains these two and that gets about 90% of what we need done. Great to see some work to add Richfaces, tag completion and a palette would be tremendous, but when do we get Facelets back in 6.1?


  • Wouter van Reeven Sunday, May 4, 2008

    Hey Geertjan,

    That's excellent! I really need to dive into the NetBeans Platform API soon to be able to create this kind of modules myself. Let's talk during JavaOne to see how this can be extended so the RichFaces tags also are in the Component Palette and can be dragged and dropped onto JSF/Facelets pages.

    Greets, Wouter


  • Geertjan Sunday, May 4, 2008

    Thanks for the comments. I will try and find out about Facelets, Scoot. Here's an additional plugin for RichFaces, as well as info on tag completion:

    http://blogs.sun.com/geertjan/entry/richfaces_for_netbeans_ide_61


  • Casper Sunday, May 4, 2008

    I agree with Scoot. We need Facelets in 6.1, it's what holds our team back in 6.0 mode.


  • Alex.deng Wednesday, July 2, 2008

    I touch richface only one week ago,there is nothing I can do before I view your topic in the website.The topic tell me how to use richfaces by NetBeans IDE 6.1.Thanks for your guide of richfaces.


  • Will Monday, September 22, 2008

    It is great! I am expecting Visual Web JSF.


  • dsaf Monday, November 24, 2008

    sdfsdfds


  • guest Wednesday, December 3, 2008

    good


  • guest Wednesday, December 3, 2008

    so astonished! thanks a lot


  • adamo901 Wednesday, December 3, 2008

    Is there something new for Netbeans 6.5


  • F&aacute;bio Henrique - Rio de Janeiro - Brasil Wednesday, February 11, 2009

    Thanks friend!

    I need this very much!

    Hug


  • Dinesh Chothe Thursday, February 12, 2009

    Excellent...

    This is really great to use richfaces with netbeans.

    Wheather it supports for JavaEE 5.0 using JBoss4.3 or 5.0 with Netbeans6.5.

    Currently it is not showing JavaEE5.0 option using JBoss.

    Thanks,

    Dinesh Chothe


  • vieri122 Monday, January 18, 2010

    support netbeans6.8??


  • Jocenildo Paraizo Tuesday, March 2, 2010

    Hi,

    Where are the plugin sources?


  • damian Tuesday, July 13, 2010

    hello, i'm trying to run the example with jsf 2.0 but when I do, it doesn't load the page but tries to download the index.xhtml page. Do you know why? tks!!


  • guest Wednesday, June 8, 2011
    I m getting error of xml when i use richfaces with bean at time of deploy
  • guest Wednesday, January 25, 2012
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.