JBoss.orgCommunity Documentation

Chapter 17. Functions

17.1. rich:clientId
17.2. rich:component
17.3. rich:element
17.4. rich:findComponent
17.5. rich:isUserInRole

Read this chapter for details on special functions for use with particular components. Using JavaServer Faces Expression Language (JSF EL), these functions can be accessed through the data attribute of components. Refer to Section 2.5.7, “data” for details on the data attribute.

The rich:clientId('id') function returns the client identifier related to the passed component identifier ('id'). If the specified component identifier is not found, null is returned instead.

The rich:component('id') function is a shortcut for the equivalent #{rich:clientId('id')}.component code. It returns the UIComponent instance from the client, based on the passed server-side component identifier ('id'). If the specified component identifier is not found, null is returned instead.

The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It returns the element from the client, based on the passed server-side component identifier. If the specified component identifier is not found, null is returned instead.

The rich:findComponent('id') function returns the a UIComponent instance of the passed component identifier. If the specified component identifier is not found, null is returned instead.


The rich:isUserInRole(Object) function checks whether the logged-in user belongs to a certain user role, such as being an administrator. User roles are defined in the web.xml settings file.