Monday, February 1, 2010

RichFaces Client Functions

RichFaces comes with four client functions to take control of a particular component. They are:

  • #{rich:clientId('id')}
  • #{rich:element('id')}
  • #{rich:component('id')}
  • #{rich:findComponent('id')}

#{rich:clientId('id')}
Suppose you have this on your page:


The following:

Would produce this:


#{rich:element('id')}
The following:

Would produce this:


#{rich:component('id')}
The following:

Would produce this:


#{rich:findComponent('id')}
Then there's #{rich:findComponent('id')}. It's cool in that it's another way to access the component on the client side. For example, lets say you want to get the value of the combo box on the client side rather then from the managed bean. You can do so like this:

When you selected a different value from combo box, it would output what you selected.

No comments:

Post a Comment