You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christopher Cudennec <cu...@web.de> on 2007/08/09 12:06:31 UTC
commandLink not working inside dataList? (TOMAHAWK-272)
Hi everybody,
I can't get the commandLink to work inside the dataList. The event is
not processed and therefore the actionListener never gets called. This
sounds like the above bug ticket that is supposed to be solved. I use
MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about this?
Thanks,
Christopher
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by Mike Kienenberger <mk...@gmail.com>.
Note that there's other reasons why command-links won't work beyond
having request-scoped backing beans. For instance, maybe validation
is failing and you don't realize it -- try putting a t:messages
component on your page. Posting more details and a simplified
version of your page/code is helpful.
On 8/17/07, francini@sago <n....@sago.fi.it> wrote:
>
> Hi Christopher, I've got the same problem, and I couldn't solve it even
> session-scopin my backing bean.
> I even tried to create the HTMLDataTable - Bean binding in the bean itself,
> as suggested elsewhere, but I didn't manage to have my commandlink working;
> so I'd like to have your workaround, if possible.
>
> Thanks in Advance,
> Niccolò Francini.
>
> Christopher Cudennec wrote:
> >
> > Hi Mike and thanks for the suggestions. Indeed you are right that my
> > bean is request scoped. I talked to some more people today and got the
> > proper understanding of how it works. I also got a workaround for my
> > problem.
> >
> > Thanks,
> >
> > Christopher
> >
> > Mike Kienenberger schrieb:
> >> A lot of times this is caused because the developer made the backing
> >> list for the t:dataTable request-scoped, or made the rendered
> >> attribute value for the commandList request-scoped.
> >>
> >> On 8/9/07, Christopher Cudennec <cu...@web.de> wrote:
> >>
> >>> Hi everybody,
> >>>
> >>> I can't get the commandLink to work inside the dataList. The event is
> >>> not processed and therefore the actionListener never gets called. This
> >>> sounds like the above bug ticket that is supposed to be solved. I use
> >>> MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about
> >>> this?
> >>>
> >>> Thanks,
> >>>
> >>> Christopher
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/commandLink-not-working-inside-dataList--%28TOMAHAWK-272%29-tf4242725.html#a12195637
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by "francini@sago" <n....@sago.fi.it>.
Thank you for your quick answer,
I already tried with the t:saveState tag and with the session bean.
I'm going to try with a lazy getter, but I'm afraid it won't work as I
should solve
the empty list problem with the htmlDataTable inside the bean (it's smart a
solution,
I really thought it would work).
Anyway I'm going to try, and then I will let you have news about the
question.
Thank you again
--
View this message in context: http://www.nabble.com/commandLink-not-working-inside-dataList--%28TOMAHAWK-272%29-tf4242725.html#a12196102
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi Niccolo!
The main problem when using a request scoped bean is that it is
recreated with each request (simple truth but the main problem ;)). So
is the result of your list that you probably created in your backing
bean. This is where the problem starts. When looking for events to be
created and called the getter of you list is invoked and is supposed to
return a number of items. (In my case the getter returned an empty list
because it was created when calling a "search" action). If the list that
is returned is empty, no event is created and therefore not action is
called.
To solve the problem you could either:
- use t:saveState (http://myfaces.apache.org/tomahawk/uiSaveState.html)
- use a session scoped bean (as you did... I'm puzzled that it does not
work)
- make a lazy implementation of the getter of the list, so create the
list when the getter is invoked for the first time
- recreate the result list yourself (that's my workaround, because we
are not sure that the elements returned by our search query is the same
each time the search method is called - another user could have inserted
a new object)
I think you should try the first three options before I start to explain
the workaround in detail ;).
Hope this helps resolving your problem.
Christopher
francini@sago schrieb:
> Hi Christopher, I've got the same problem, and I couldn't solve it even
> session-scopin my backing bean.
> I even tried to create the HTMLDataTable - Bean binding in the bean itself,
> as suggested elsewhere, but I didn't manage to have my commandlink working;
> so I'd like to have your workaround, if possible.
>
> Thanks in Advance,
> Niccolò Francini.
>
> Christopher Cudennec wrote:
>
>> Hi Mike and thanks for the suggestions. Indeed you are right that my
>> bean is request scoped. I talked to some more people today and got the
>> proper understanding of how it works. I also got a workaround for my
>> problem.
>>
>> Thanks,
>>
>> Christopher
>>
>> Mike Kienenberger schrieb:
>>
>>> A lot of times this is caused because the developer made the backing
>>> list for the t:dataTable request-scoped, or made the rendered
>>> attribute value for the commandList request-scoped.
>>>
>>> On 8/9/07, Christopher Cudennec <cu...@web.de> wrote:
>>>
>>>
>>>> Hi everybody,
>>>>
>>>> I can't get the commandLink to work inside the dataList. The event is
>>>> not processed and therefore the actionListener never gets called. This
>>>> sounds like the above bug ticket that is supposed to be solved. I use
>>>> MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about
>>>> this?
>>>>
>>>> Thanks,
>>>>
>>>> Christopher
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by "francini@sago" <n....@sago.fi.it>.
Hi Christopher, I've got the same problem, and I couldn't solve it even
session-scopin my backing bean.
I even tried to create the HTMLDataTable - Bean binding in the bean itself,
as suggested elsewhere, but I didn't manage to have my commandlink working;
so I'd like to have your workaround, if possible.
Thanks in Advance,
Niccolò Francini.
Christopher Cudennec wrote:
>
> Hi Mike and thanks for the suggestions. Indeed you are right that my
> bean is request scoped. I talked to some more people today and got the
> proper understanding of how it works. I also got a workaround for my
> problem.
>
> Thanks,
>
> Christopher
>
> Mike Kienenberger schrieb:
>> A lot of times this is caused because the developer made the backing
>> list for the t:dataTable request-scoped, or made the rendered
>> attribute value for the commandList request-scoped.
>>
>> On 8/9/07, Christopher Cudennec <cu...@web.de> wrote:
>>
>>> Hi everybody,
>>>
>>> I can't get the commandLink to work inside the dataList. The event is
>>> not processed and therefore the actionListener never gets called. This
>>> sounds like the above bug ticket that is supposed to be solved. I use
>>> MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about
>>> this?
>>>
>>> Thanks,
>>>
>>> Christopher
>>>
>>>
>>
>>
>>
>
>
>
--
View this message in context: http://www.nabble.com/commandLink-not-working-inside-dataList--%28TOMAHAWK-272%29-tf4242725.html#a12195637
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi Mike and thanks for the suggestions. Indeed you are right that my
bean is request scoped. I talked to some more people today and got the
proper understanding of how it works. I also got a workaround for my
problem.
Thanks,
Christopher
Mike Kienenberger schrieb:
> A lot of times this is caused because the developer made the backing
> list for the t:dataTable request-scoped, or made the rendered
> attribute value for the commandList request-scoped.
>
> On 8/9/07, Christopher Cudennec <cu...@web.de> wrote:
>
>> Hi everybody,
>>
>> I can't get the commandLink to work inside the dataList. The event is
>> not processed and therefore the actionListener never gets called. This
>> sounds like the above bug ticket that is supposed to be solved. I use
>> MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about this?
>>
>> Thanks,
>>
>> Christopher
>>
>>
>
>
>
Re: commandLink not working inside dataList? (TOMAHAWK-272)
Posted by Mike Kienenberger <mk...@gmail.com>.
A lot of times this is caused because the developer made the backing
list for the t:dataTable request-scoped, or made the rendered
attribute value for the commandList request-scoped.
On 8/9/07, Christopher Cudennec <cu...@web.de> wrote:
> Hi everybody,
>
> I can't get the commandLink to work inside the dataList. The event is
> not processed and therefore the actionListener never gets called. This
> sounds like the above bug ticket that is supposed to be solved. I use
> MyFaces 1.1.5 and Tomahawk 1.1.6. Can anybody confirm or comment about this?
>
> Thanks,
>
> Christopher
>