You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Zarick Lau <za...@gmail.com> on 2007/06/25 13:22:21 UTC

[Trinidad] Request scope backing bean and tr:table

Hi list,

I've a tr:table, the table contents are fetched by the request scoped
backing bean.
One of the column contains a commandLink with a static "action" string.

However, I found that, the commandLink action is never fired when I click on
it.

I finally figure out that, during post-back, Trinidad try to lookup the
table value.
I can only make the backing bean refetch the table rows during Bean init
time.

In my understanding, the value of component should be saved by JSF state
manager,
am I true?
It true, why, the table component try to get the value again when post-back?

If false, is there any better way for my simple use-case.

In my case, the user select one row my clicking on the commandLink in one of
the cell.
And the user will typically redirect to a new page. so a plain new refetch
of the whole table content
looks waste of resource for me.

Thanks,
Zarick

Re: [Trinidad] Request scope backing bean and tr:table

Posted by Zarick Lau <za...@gmail.com>.
Hi Adam,


> >
> > In my understanding, the value of component should be saved by JSF state
> > manager,
> > am I true?
>
> No, that's not the case.  Anything that is retrieved from
> EL is left alone by JSF state management.


So, that's I misunderstood it !!

Thanks for your answer!

Zarick

Re: [Trinidad] Request scope backing bean and tr:table

Posted by Zarick Lau <za...@gmail.com>.
Hi Christopher,

yes that's the way it works as "request"-scope means that the bean is
> recreated each time ;). Try googling for some more information about
> those two alternatives or look at this [1] . That seems to be exactly
> what you have.



Ok, thanks again!

Regards,
Zarick

Re: [Trinidad] Request scope backing bean and tr:table

Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi Zarick,

yes that's the way it works as "request"-scope means that the bean is 
recreated each time ;). Try googling for some more information about 
those two alternatives or look at this [1] . That seems to be exactly 
what you have.

Cheers,

Christopher

[1] 
http://myfaces.apache.org/trinidad/devguide/communicatingBetweenPages.html

Zarick Lau schrieb:
> Hi Christopher,
>
>
> On 6/25/07, *Christopher Cudennec* <SmutjeJim@gmx.net 
> <ma...@gmx.net>> wrote:
>
>     You probably should use another scope for your bean in Trinidad,
>     either
>     session or pageFlowScope. In Tomahawk you could use t:saveState.
>
>
> Thanks.
> However, is it the "common" way for handling this kind of use case?
> (ie, loading a table, user select one record, and proceed to next page)
>
>
> Thanks,
> Zarick
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.472 / Virus Database: 269.9.6/865 - Release Date: 24.06.2007 08:33
>   


Re: [Trinidad] Request scope backing bean and tr:table

Posted by Zarick Lau <za...@gmail.com>.
Hi Christopher,


On 6/25/07, Christopher Cudennec <Sm...@gmx.net> wrote:
>
> You probably should use another scope for your bean in Trinidad, either
> session or pageFlowScope. In Tomahawk you could use t:saveState.
>

Thanks.
However, is it the "common" way for handling this kind of use case?
(ie, loading a table, user select one record, and proceed to next page)


Thanks,
Zarick

Re: [Trinidad] Request scope backing bean and tr:table

Posted by Christopher Cudennec <Sm...@gmx.net>.
You probably should use another scope for your bean in Trinidad, either 
session or pageFlowScope. In Tomahawk you could use t:saveState.

-- Christopher

Adam Winer schrieb:
> On 6/25/07, Zarick Lau <za...@gmail.com> wrote:
>> Hi list,
>>
>> I've a tr:table, the table contents are fetched by the request scoped
>> backing bean.
>> One of the column contains a commandLink with a static "action" string.
>>
>> However, I found that, the commandLink action is never fired when I 
>> click on
>> it.
>>
>> I finally figure out that, during post-back, Trinidad try to lookup the
>> table value.
>> I can only make the backing bean refetch the table rows during Bean init
>> time.
>>
>> In my understanding, the value of component should be saved by JSF state
>> manager,
>> am I true?
>
> No, that's not the case.  Anything that is retrieved from
> EL is left alone by JSF state management.
>
> -- Adam
>
>> It true, why, the table component try to get the value again when 
>> post-back?
>>
>> If false, is there any better way for my simple use-case.
>>
>> In my case, the user select one row my clicking on the commandLink in 
>> one of
>> the cell.
>> And the user will typically redirect to a new page. so a plain new 
>> refetch
>> of the whole table content
>> looks waste of resource for me.
>>
>> Thanks,
>> Zarick
>>
>>
>
>


Re: [Trinidad] Request scope backing bean and tr:table

Posted by Adam Winer <aw...@gmail.com>.
On 6/25/07, Zarick Lau <za...@gmail.com> wrote:
> Hi list,
>
> I've a tr:table, the table contents are fetched by the request scoped
> backing bean.
> One of the column contains a commandLink with a static "action" string.
>
> However, I found that, the commandLink action is never fired when I click on
> it.
>
> I finally figure out that, during post-back, Trinidad try to lookup the
> table value.
> I can only make the backing bean refetch the table rows during Bean init
> time.
>
> In my understanding, the value of component should be saved by JSF state
> manager,
> am I true?

No, that's not the case.  Anything that is retrieved from
EL is left alone by JSF state management.

-- Adam

> It true, why, the table component try to get the value again when post-back?
>
> If false, is there any better way for my simple use-case.
>
> In my case, the user select one row my clicking on the commandLink in one of
> the cell.
> And the user will typically redirect to a new page. so a plain new refetch
> of the whole table content
> looks waste of resource for me.
>
> Thanks,
> Zarick
>
>