a4j:actionparam

Component identification parameters

Name | Value
--- | ---
component-type | org.ajax4jsf.ActionParameter
component-class | org.ajax4jsf.component.html.HtmlActionParameter

## Creating on a page

Simple component definition example:

Example:

    <a4j:actionparam noEscape="true" name="param1" value="getMyValue()" assignTo="#{bean.prop1}" />

## Creating the Component Dynamically Using Java

Example:

    import org.ajax4jsf.component.html.HtmlActionParameter;
    ...
    HtmlActionParameter myActionParameter = new HtmlActionParameter();
    ...

## Key attributes and ways of usage

The component <a4j:actionparam> is a combination of the functionality of two JSF tags: <f:param> and <f:actionListener> .

At the render phase, it's decoded by parent component ( <h:commandLink> or like) as usual. At the process request phase, if the parent component performs an action event, update the "value" specified in the "assignTo" attribute as its "value". If a "converter" attribute is specified, use it to encode and decode the "value" to a string stored in the html parameter.

<a4j:actionparam> has a "noEscape" attribute. If it is set to "true", the "value" is evaluated as a JavaScript code.

Example:

    ...
    <script>
        ...
        var foo = "bar";
        ...
    </script>
    ...
    <a4j:actionparam noEscape="true" name="param1" value="foo" assignTo="#{bean.prop1}" />
    ...

The <a4j:param> extends <f:param>, so the "name" attribute is mandatory. Otherwise, the "value" misses due missing the request parameter name for it.

## Relevant resources links

On the component LiveDemo page you can see the example of <a4j:actionparam> usage and sources for the given example.

More information can be found on the Ajax4jsf Users Forum.