Creating simple toolbar using RichFaces tag library

rich:toolBar, rich:dropDownMenu and rich:menuItem

This example demonstrates how to create simple toolbar using RichFaces tag library. RichFaces provides predefined tags like rich:toolBar which will be easily plugged into our webpages to display the toolbar component. Apart from rich:toolBar, to create menus we have to use other tags rich:dropDownMenu and rich:menuItem.

also read:

rich:dropDownMenu is used for creating the group of menus and inside that use rich:menuItem to add a single menu. You can view the image in this article bottom to know how it looks like.


<%@taglib prefix="f" uri=""%>
<%@taglib prefix="h" uri=""%>
<%@ taglib prefix="rich" uri="" %>
<%@ taglib prefix="a4j" uri=""%>
                        <f:facet name="label">
                            <h:outputText value="File"/>
                        <rich:menuItem value="New"/>
                        <rich:menuItem value="Open"/>
                        <rich:menuItem value="Exit"/>
                        <f:facet name="label">
                            <h:outputText value="Edit"/>
                        <rich:menuItem value="Find"/>
                        <rich:menuItem value="Replace"/>

view in browser




About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Speak Your Mind


Please support the site
By clicking any of these buttons you help our site to get better