> Shouldn't this happen with request scope to request scope bean associations
> as well?  If I set a parameter on a commandButton, shoudn't it be passed as
> a request parameter?  I have not been able to get JSF to automatically set a
> request-scoped bean's property upon creation from a request parameter using
> the managed property facility.
> 
> If I understand correctly this:
> 
> <h:commandButton id="somebutton" action="#{bean.someAction}"
> actionListenter="#{bean.someActionListener}" >
>  <f:param name="someParam" value="#{bean.someProperty}" />
> </h:commandButton>
> 
> Should result in request parameter "someParam" being sent to the result of
> the navigation outcome of "someAction"?

I believe what is actually happening here is that you are setting the 
value of someParam when you are creating the commandButton for the
first time.  You are setting that parameter to the value of
bean.someProperty which is presumably null.

When the form is submitted the command button (and its param) are
restored from state (restore view phase).  If "bean" is request scope
that bean is created all over again with whatever default values you
"someProperty" would have (again, presumably null).

The requestScope parameter is never mapped back to your bean.  Its
just for setting an extra hidden value to be posted back via your
form.  I would use this to post back an id or something and then use
requestMap in your action listener to get the value.

Make sense?

> -Mark

sean

Reply via email to