An Introduction To JBoss RichFaces
Creating user interface
In the WebContent folder, create a page called user.xhtml with the following content:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j">
<head>
<title>RichFaces</title>
</head>
<body>
<h:form>
<rich:panel>
<f:facet name="header">
Just some users
</f:facet>
<rich:dataTable value="#{userBean.users}" var="user">
<h:column>
<h:outputText id="name" value="#{user.name}"/>
</h:column>
<h:column>
<h:outputText id="email" value="#{user.email}"/>
</h:column>
</rich:dataTable>
</rich:panel>
</h:form>
</body>
</html>
The page is also very simple. We just display all the users we created inside the managed bean using the rich:dataTable component. At this point we are ready to test the application.
Running on a server
1. Make sure everything is saved.
2. In Servers view, right click the server and select Start
3. Right click users.xhtml and select Run As/Run on Server
4. Click Finish
A Web browser window should open displaying users in a table.
The next step is to add a button to each column, which when clicked will open a modal panel with user details.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Yeray Rodriguez replied on Mon, 2009/07/06 - 7:53am
Hi,
I'm using this code on a seam project and it work properly, but, it doesn't work when the table datatable is sorted. I don't know how to get the row id after user has sorted the table. Now I use the position inside the List of elements I pass to the datatable.
thanks in advance
sarah mark replied on Thu, 2009/08/13 - 4:57am
I must say great website. I have just googled it nice info out there.
Thanks,
Acne
James Bondy replied on Fri, 2009/08/28 - 2:43am
in response to:
Brian ray
It doesn't work to me too, can you upload this files again?
Thanks,
Levitra
Edwin William replied on Mon, 2009/09/07 - 2:16pm
nabil esseme7 replied on Thu, 2009/10/01 - 10:24am
hi maxkatz and thank toy for your wonderful example,
i tried your code and this works fine until i want to add the modal panel and the save and close codes to the user.jsp page
i got this exception when i do that:
the content of my user.jsp is :
any ideas?
thans in advance
Ken Kham replied on Fri, 2009/10/02 - 6:53am
Max Katz replied on Thu, 2009/10/08 - 10:23pm
in response to:
Ken Kham
Max Katz replied on Thu, 2009/10/08 - 10:23pm
in response to:
nabil esseme7
john green green replied on Mon, 2009/10/26 - 3:28am
Dragan Mijailovic replied on Wed, 2009/10/28 - 8:07am
Can I use "keepAlive bean" for the <rich:tree/> component? For example:
<a4j:keepAlive name="someForm"/>
<rich:tree value="#{someForm.data}">
Max Katz replied on Wed, 2009/10/28 - 10:20pm
in response to:
Dragan Mijailovic
Dragan Mijailovic replied on Thu, 2009/10/29 - 8:41am
Thanks a lot. The "keepAlive bean" or bean with page scope should implement the java.io.Serializable interface and because of that I asked about "keepAlive bean" and rich:tree component. I see that org.richfaces.model.TreeNode implements java.io.Serializable interface.
Now, my example with rich:tree is good except I can't know when a node is collapsed. I use this example http://stackoverflow.com/questions/1509962/is-there-an-event-for-collapsing-a-richtree-node
but state.isExpanded(key) is always true!
ely towers replied on Tue, 2009/11/10 - 9:46pm
Im having problems with the save button its saying that it cannot find save method on bean file
here is user.xhtml
Eskendir Mulu replied on Mon, 2009/11/16 - 2:18pm
Is there an out of the box solution to filter tree objects, just like <rich:dtatTable>? if there is none, how would you go about implementing this fuctionality. I'm trying to implement help page.
thanks
Eskendir Mulu replied on Mon, 2009/11/16 - 2:35pm
Chhavi Jain replied on Fri, 2010/01/29 - 5:06am
What are the two themes which we can use in<rich:editor>?
If i use advanced theme then it displays buttons which i have not specified in configuration file,else it doesnt display specified buttons.Please tell me y?
Sami Meddeb replied on Wed, 2010/03/10 - 1:53pm
in response to:
marius batrinu
Shilpa Reddy replied on Mon, 2010/12/06 - 5:51pm
1. When I click edit in the dataTable the Model Panel pops up but it not populated .
2. It throws an on the below line in the modal Panel
h:inputText id="nameInput" value="#{userBean.selectedUser.name}"
Error:
javax.el.PropertyNotFoundException: /user.xhtml @55,81 value="#{userBean.selectedUser.name}": Target Unreachable, 'selectedUser' returned null
.....
Any help is much appreciated.
Thanks!
Sarwo Edi Wibowo replied on Tue, 2010/12/28 - 11:14pm
Peter Sule replied on Wed, 2011/01/05 - 8:26am
Max Katz replied on Thu, 2011/01/27 - 12:39pm
in response to:
Sarwo Edi Wibowo
Max Katz replied on Thu, 2011/01/27 - 12:40pm
in response to:
Peter Sule
ezd ass replied on Thu, 2011/02/17 - 9:40am
David May replied on Mon, 2011/04/11 - 11:33pm
in response to:
ezd ass
David May replied on Mon, 2011/04/11 - 11:49pm
in response to:
Max Katz
Max Katz replied on Mon, 2011/04/18 - 12:21pm
in response to:
David May
Majid Lotfi replied on Thu, 2011/05/12 - 1:38pm
Hi,
I downloaded eclipse but could not find the directory :
org.jboss.tools.common.projecttemplates_X.X.X
under plugins
can you please help.
thanks