You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Simon Watson <si...@gmail.com> on 2005/02/26 19:08:13 UTC

Request scope beans cause commandLink to fail in dataTable / dataList

Hi there, I've been using MyFaces 1.0.8 for the past few weeks and,
having been impressed with its robustness to date, I've encountered a
strange problem which I can't seem to overcome.

I'm displaying a list of items from a request-scope managed bean using
x:dataList (the problem also occurs if I use a standard dataTable).
The list displays fine but commandLinks within the list don't seem to
work. If I change the scope of the bean to session, then everything
works ok although I'd prefer to keep the amount of session data to a
minimum. Can anyone tell me what's going on?

To give a bit more detail, I have a JSP page with a commandLink
containing an <f:param> tag. This invokes an action on an
application-scope managed bean which gets the request-scope bean...

context.getApplication().getVariableResolver().resolveVariable(context,
"requestbean");

...and populates its data (using DB queries based on the f:param
value). One of the request bean's properties is a List. The action
returns a standard string which directs the navigation handler to the
next JSP.

This JSP displays the request bean's list fine but commandLinks within
the list won't work. Placing one of the links outside the
dataList/dataTable does work.

This is driving me nuts, can anyone enlighten me as to why this is
happening and if there's a workaround?

Any help would be very much appreciated.

Thanks,

Simon.

Re: Request scope beans cause commandLink to fail in dataTable / dataList

Posted by Sean Schofield <se...@gmail.com>.
I have successfully used commandLink with f:param in a dataTable.  If
I get a chance I will try to provide you with a working example.  In
the meantime maybe it will help you to know that it is at least
possible!

sean


On Sat, 26 Feb 2005 18:08:13 +0000, Simon Watson <si...@gmail.com> wrote:
> Hi there, I've been using MyFaces 1.0.8 for the past few weeks and,
> having been impressed with its robustness to date, I've encountered a
> strange problem which I can't seem to overcome.
> 
> I'm displaying a list of items from a request-scope managed bean using
> x:dataList (the problem also occurs if I use a standard dataTable).
> The list displays fine but commandLinks within the list don't seem to
> work. If I change the scope of the bean to session, then everything
> works ok although I'd prefer to keep the amount of session data to a
> minimum. Can anyone tell me what's going on?
> 
> To give a bit more detail, I have a JSP page with a commandLink
> containing an <f:param> tag. This invokes an action on an
> application-scope managed bean which gets the request-scope bean...
> 
> context.getApplication().getVariableResolver().resolveVariable(context,
> "requestbean");
> 
> ...and populates its data (using DB queries based on the f:param
> value). One of the request bean's properties is a List. The action
> returns a standard string which directs the navigation handler to the
> next JSP.
> 
> This JSP displays the request bean's list fine but commandLinks within
> the list won't work. Placing one of the links outside the
> dataList/dataTable does work.
> 
> This is driving me nuts, can anyone enlighten me as to why this is
> happening and if there's a workaround?
> 
> Any help would be very much appreciated.
> 
> Thanks,
> 
> Simon.
>