PhotoAlbum Application Download Support Developer Guide
Resources/Beans Handling
Ajax Miscellaneous
Tag Information

a4j:actionparam is a component that combines together the functionality of f:param and ActionListener. Additionally to the f:param, this component allows to assign the value to the property of the manager bean directly using the assignTo attribute.

ActionParameter Demo
Selected Name:

View Source

You can use a4j:param not only with ajax components, but with non-ajax command component also. In the following example, the used skin of the demo is changed when the whole page is refreshed with the regular non-ajax h:commandLink. Using this feature you can update model values without invoking even a single line of java code on the server side.

ActionParameter Demo
Change Demo Appplication Skin To:

View Source

Attributes 'name' and 'value' are mandatory. You can specify the converter with 'converter' attribute if you need to convert the value before the model is updates. Note that the property is assigned with a parameter value on the UPDATE_MODEL phase. Thus, if the validation of the form is failed, this phase will be skipped and the property is not updated.

It is possible to use javascript variable of custom function for the 'value' attribute. In this case the 'noEscape' attribute should be set to true. When noEscape="true", the 'value' can contain any javascript expression or javascript function invocation and the result of them will be send to the server as a value of a4j:actionparam. The following example demonstrates how to assign the backing bean with browser screen size values.

ActionParameter Demo


View Source
RichFaces Wiki RichFaces Project Site