Thursday, March 4, 2010

New Richfaces examples

We have created some new Richfaces examples for people to get started with. We had very simple goal in our mind when we created these example applications that the examples should be easy enough for people to understand and to see some most popular Richfaces components in use. We did not want to bore you all with yet another set of manuals. Instead there is a simple README if needed. All of these apps are tested with Richfaces 3.3.3.CR1 which has a partial support for JSF2. Richfaces 4.x series will have full JSF2 support.

Tic-Tac-Toe hardly needs an explanation and is the simplest of three examples. Please get the code from Pavol-Tictactoe-Code/ Here you see a4j:support and a4j:params in use with graphicImage and selectBooleanCheckbox and as well as examples of a4j:commandButton and Richfaces's Tab Panel, DataTable. This is JSF1.2 based and should run fine on both JBoss AS5 and Tomcat6.

Richrates converts Euros to about 30 foreign currencies and vice versa. The application gets data from European Central Bank on the fly. It is based on JSF2 and has been tested on JBoss AS6 M2 but it should run fine on Tomcat6 as well with proper jsf jars. Here you can see some JSF2 features in action such as bean annotation, implicit navigation. Richfaces components in use are Graph Validator, Calendar, Datagrid, Drag Indicator etc. Please see the code at Pavol-Richrates-Code/.



Ribber is Richfaces XMPP client. It is based on JSF2, Weld and Smack and has been tested on JBoss AS6 M2. Grab the code from Lukas-Ribber-Code Here you will see some JEE6 features in use such as javax.enterprise.event.*, javax.inject.* and Richfaces components in use are rich:tree, rich:jquery, rich:hotkey, rich:message, a4:push, a4j:poll. This app is quite cutting edge and if you have just started on CDI, this example will serve you well as well.

The complete credit for these apps goes to my team members Lukas Fryc and Pavol Pitonak. If you have any question, please free to join Richfaces User Forum.

Wednesday, February 17, 2010

GateIn Portal now available in Nepali

Thanks to Mr. Bimal Thapa, an OSS contributor from Nepal, GateIn portal project is now partially translated into Nepali. Here is one screen shot:

Of course being a Nepali, I am really proud of this but what makes it even sweeter is that I met Bimal as part of my Open Source Software (OSS) event during my last visit to Nepal. I would like to think that the event is partially responsible to bring Bimal jee on board. ;-) Please help me spread the word.

If you want to join the fun, please contact me. There are still some polishing to do.

Saturday, January 16, 2010

Official Google Blog: A new approach to China

Official Google Blog: A new approach to China

Wednesday, January 13, 2010

Looking for Volunteers to Translate GateIn into Nepali

This message goes out to all Nepali OSS community. Currently a open source portal project called GateIn (www.gatein.org) is looking for volunteers to translate GateIn into many languages. Being somebody who is involved with this project and being a Nepali, it will give me an immense pleasure to see GateIn translated to Nepali as well. The details of task is at http://community.jboss.org/wiki/TranslatingGateIn . Please shoot me an email if you are interested.

Your rewards:
1. You can call yourself a OSS committer and brag about it.
2. Feel good that you are able to do a bit to expand Nepal's footprint in OSS community
3. Acknowledgment from the project lead
4. A project T-Shirt

Wednesday, December 23, 2009

Book Review: Packt's JBoss Richfaces 3.3

Packt folks sent me a copy of "JBoss Richfaces 3.3" so that I could do a review of the book in my blog. I am almost done with the book and probably would have started on writing review over the holidays break but another review came up which pretty much is in line with what I have in mind. You can read it at http://edemmorny.wordpress.com/2009/12/22/book-review-packts-jboss-richfaces-3-3/ . Thanks Edem for saving me some typing. I would still like to summarize the book in few bullet points:

Good Points:
  • A complete application from start to finish along with Seam and JPA integration.
  • Good explanation of some core Richfaces concepts such as placeholder, ajaxSingle, region, process
  • Skinning support and how you can create yours
  • Good use case for Poll, Push, data iteration component and its partial update
Not so good points:
  • First five chapters of book is equally split between Richfaces, Seam and JPA. Given that this book is for beginner, these other frameworks add to the complexity and more than likely will confuse reader.
  • Seam is a great framework but it's not a must have to use Richfaces. The book gives you an impression that you can not get easily started with Richfaces without Seam and seamgen.
How would I have written this book:

Given that the book is tailored towards readers who are familiar with JSF 1.2 ,I would have started with a simple JSF project and added Richfaces feature
on top of the project. Then describe how Richfaces lifecycle fits into JSF lifecyle and so on. This way transition is smooth and helps a reader see how Richfaces fits well with JSF. Most of users who post questions in Richfaces user forum fall into the group who know JSF and want to know more about Richfaces.

I wish you happy holidays and a great new year.

Tuesday, August 25, 2009

Richfaces: immediate vs bypassUpdates attributes

If you are familiar with JSF then you know when to use immediate attribute. If not, here is a quick refresher. JSF has six different phases:
  1. Restore View - Creates or restores the previous page.

  2. Apply Request Values - Set component submitted values to request values.

  3. Process Validations - Convert and validate component values. Set component values to submitted values if valid.

  4. Update Model Values - Set backing bean values to component values.

  5. Invoke Application - Execute actionListeners and actions.

  6. Render Response - Return response.

When immediate is set to true, action components call navigation handler just after 2nd phase and skip 3-5 phases. The most common usecase is with cancel button on a form i.e. when user clicks on Cancel button, you don't want to force user to enter correct values.

Now with bypassUpdates attribute, only 4-5 phases are skipped; validation happens as usual. To credit Nick Belaevski for giving a concrete example of a sign up form, you can have one button in form to cancel (set immediate=true) and another checks whether screenname is already taken (set bypassUpdates=true). Obviously, setting both to true for same component does not make sense. If you are still not clear, here is code snippet from org. ajax4jsf.component.AjaxActionComponent
if (event instanceof ActionEvent) {
if (event.getComponent() == this) {
if (isImmediate()) {
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
} else if (isBypassUpdates()) {
event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
} else {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
// UICommand set Phase ID for all ActionEvents - bypass it.
getParent().queueEvent(event);
}
It should be crystal clear now...at least it was for me.

Tuesday, August 4, 2009

Now you can tweet from JBoss Portal

Introducing Twitter portlet for JBoss Portal and Enterprise Portal platform. It's based on twitter4j, Richfaces, JBoss Portlet Bridge.

Using this portlet, you can
  • Update your status
  • Get messages that are sent directly to you (e.g. @prabhatjha in my case)
  • Get list of folks who you are following and get their latest status. List is sortable.
I would say that this is basic but my goal was to have something for folks to get started with. twitter4j exposes various twitter api which you can use to customize this portlet for your need. I will leave that as an exercise for reader (I always wanted to say that ;-) ) Here are some screen shots:





You can grab the code from http://anonsvn.jboss.org/repos/qa/prabhat/twitter-portlet/ But this portlet can very well run on other portal servers as well if you know what deployment descriptors you need to modify.