RichFaces rich:notifyStack

RichFaces Rich NotifyStack with features, configuration, architecture, a4j:log, a4j:ajax, a4j:commandlink, a4j:outputpanel,rich:autocomplete, rich:fileupload, rich:list, rich:panel, rich:datascroller, rich:dropdownmenu, rich:messages, rich:progressbar, rich:tooltip etc.

RichFaces rich:notifyStack

RichFaces rich:notifyStack

This component is used to define the position of messages at the web page. Messages displayed by <rich:notifyStack> or <rich:notifyMessage> are displayed in top-right corner of the web page by default.

It is <rich:notifyStack> which defines where messages will appear. It also provides the way of removing messages from screen.

Style classes and skin parameters

The following table contains the style classes and corresponding skin parameters for the notifyStack.

Class Function Skin Parameters Mapped CSS properties
.rf-ntf-pos-tl It is used to define where top-left stack of notification will be positioned. No skin parameters.  
.rf-ntf-pos-tr It is used to define where top-right stack of notification will be positioned. No skin parameters.  
.rf-ntf-pos-bl It is used to define where bottom-left stack of notification will be positioned. No skin parameters.  
.rf-ntf-pos-br It is used to define where bottom-right stack of notification will be positioned. No skin parameters.  

Example:

Here, in the following example, we are implementing <rich:notify> component. This example contains the following files.

JSF File

// rich-notify-stack.xhtml

  1. <ui:composition xmlns="http://www.w3.org/1999/xhtml"  
  2. xmlns:h="http://java.sun.com/jsf/html"  
  3. xmlns:a4j="http://richfaces.org/a4j"  
  4. xmlns:rich="http://richfaces.org/rich"  
  5. xmlns:f="http://java.sun.com/jsf/core"  
  6. xmlns:ui="http://java.sun.com/jsf/facelets">  
  7. <f:view>  
  8. <h:head>  
  9. <title>Rich Notify Stack </title>  
  10. </h:head>  
  11. <h:body>  
  12. <h:form>  
  13. <h:outputText value="User Name " />  
  14. <h:inputText label="user name"  
  15. id="user-name"  
  16. required="true"  
  17. value="#{user.name}">  
  18. <f:validateLength minimum="5" maximum="20" />  
  19. </h:inputText><br/><br/>  
  20. <h:commandButton value="submit"/>  
  21. <rich:notifyStack position="topRight">  
  22. <rich:notifyMessage for="user-name"/>  
  23. </rich:notifyStack>  
  24. </h:form>  
  25. </h:body>  
  26. </f:view>  
  27. </ui:composition>  

Managed Bean

// User.java

  1. import javax.faces.bean.ManagedBean;  
  2. import javax.faces.bean.RequestScoped;  
  3. @ManagedBean  
  4. @RequestScoped  
  5. public class User {  
  6. String name;  
  7. public String getName() {  
  8. return name;  
  9. }  
  10. public void setName(String name) {  
  11. this.name = name;  
  12. }  
  13. }