Here myBean.myBeanArg will receive the value returned by the javascript function getTheValue().

Notice the noEscape="true" attribute. This is needed because otherwise the data inside value would be enclosed in single quotes and escaped, resulting in no javascript execution. As stated in the documentation:

It is possible to use JavaScript expression or function in the "value"
attribute. In this case the "noEscape" attribute should be set to
"true". The result of this JavaScript invocation is sent to the server
as a value of <a4j:actionparam>.