RichFaces provides a set of JavaScript functions to make working with the DOM tree and client side component API easier.

Here is the current list:

- r:clientId(id) - returns client Id for component by it's short id.
- r:element(id) - returns DOM element for the passed short id
- r:component(id) - returns richfaces client component instance to call some API method.
- r:isUserInRole(role) - returns if the user has specified role.
- r:findComponent(id) - returns component instance for given short id
- r:jQuery(id) - returns a jQuery object with an element for given short id

As an example, the result of # {r:element('input')} expression would be the same as calling: document.getElementById('formId:input').

Below is another example that shows how to pull a value directly from a component using the r:findComponent call.