I am working on JSF 2.0, Richfaces 4.0. I am having an requirement where I need to show error message when there is any backend exception occurs. We are displaying a list of users using rich:dataTable. While getting the users list if there is any back end exception occurs, then I need to show error message on the top.
In the backing bean, we are having one variable usersList. In the getUsersList() method, we are calling the db in order to get the users list.
<rich:dataTable value="#{myBean.usersList}>
</rich:dataTable>
Whenever the exception occurs, I am catching that exception in getUsersList() method and constructing FacesMessage obj and adding that message obj to FacesContext. I am using
<rich:messages />
tag to display the error messages. Bu the error message is not displaying.
Can anyone help me on this?
Thanks in advance.