You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave Brondsema <da...@brondsema.net> on 2006/09/06 21:55:12 UTC
h:dataTable's data evaluated twice per request?
I have an h:dataTable and it's value binding is invoked twice per
request. First in the APPLY_REQUEST_VALUES phase, then in the
RENDER_RESPONSE. Even when I use a immediate commandLink to move to a
different page, it is invoked in the APPLY_REQUEST_VALUES phase
seemingly unnecessarily.
Is there any way around this?
Thanks,
--
Dave Brondsema
Software Developer
Cornerstone University
Re: h:dataTable's data evaluated twice per request?
Posted by Dave Brondsema <da...@brondsema.net>.
Even for a commandLink APPLY_REQUEST_VALUES needs to be execute for the
commandLink to work. So it looks like the proper solution is not try to
do anything different with regards to JSF but to do better optimization
and caching of the value binding in the backing bean.
Dave Brondsema wrote:
> My dataTable contains no input components, so it doesn't need to
> evaluate the value then, right? Is there any logic I can put in my
> backing bean ... or in an extended dataTable so that the evaluation is
> skipped in APPLY_REQUEST_VALUES?
>
> Cagatay Civici wrote:
>> Hi Dave,
>>
>> It's because the value is evaluated for a value change event.
>>
>> Cagatay
>>
>> On 9/6/06, *Dave Brondsema* < dave@brondsema.net
>> <ma...@brondsema.net>> wrote:
>>
>>
>> I have an h:dataTable and it's value binding is invoked twice per
>> request. First in the APPLY_REQUEST_VALUES phase, then in the
>> RENDER_RESPONSE. Even when I use a immediate commandLink to move to a
>> different page, it is invoked in the APPLY_REQUEST_VALUES phase
>> seemingly unnecessarily.
>>
>> Is there any way around this?
>>
>> Thanks,
>>
>> --
>> Dave Brondsema
>> Software Developer
>> Cornerstone University
>>
>>
>>
>>
>
>
--
Dave Brondsema
Software Developer
Cornerstone University
Re: h:dataTable's data evaluated twice per request?
Posted by Mike Kienenberger <mk...@gmail.com>.
On 9/7/06, Dave Brondsema <da...@brondsema.net> wrote:
> My dataTable contains no input components, so it doesn't need to
> evaluate the value then, right? Is there any logic I can put in my
> backing bean ... or in an extended dataTable so that the evaluation is
> skipped in APPLY_REQUEST_VALUES?
You should be using this pattern for any "expensive" or "side-effect"
accessor. JSF may call your getter many times during a request.
private Object cachedObject;
public Object getObject()
{
if (null == cachedObject)
{
cachedObject = ....
}
return cachedObject;
}
Re: h:dataTable's data evaluated twice per request?
Posted by Dave Brondsema <da...@brondsema.net>.
My dataTable contains no input components, so it doesn't need to
evaluate the value then, right? Is there any logic I can put in my
backing bean ... or in an extended dataTable so that the evaluation is
skipped in APPLY_REQUEST_VALUES?
Cagatay Civici wrote:
> Hi Dave,
>
> It's because the value is evaluated for a value change event.
>
> Cagatay
>
> On 9/6/06, *Dave Brondsema* < dave@brondsema.net
> <ma...@brondsema.net>> wrote:
>
>
> I have an h:dataTable and it's value binding is invoked twice per
> request. First in the APPLY_REQUEST_VALUES phase, then in the
> RENDER_RESPONSE. Even when I use a immediate commandLink to move to a
> different page, it is invoked in the APPLY_REQUEST_VALUES phase
> seemingly unnecessarily.
>
> Is there any way around this?
>
> Thanks,
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>
--
Dave Brondsema
Software Developer
Cornerstone University
Re: h:dataTable's data evaluated twice per request?
Posted by Cagatay Civici <ca...@gmail.com>.
Hi Dave,
It's because the value is evaluated for a value change event.
Cagatay
On 9/6/06, Dave Brondsema <da...@brondsema.net> wrote:
>
>
> I have an h:dataTable and it's value binding is invoked twice per
> request. First in the APPLY_REQUEST_VALUES phase, then in the
> RENDER_RESPONSE. Even when I use a immediate commandLink to move to a
> different page, it is invoked in the APPLY_REQUEST_VALUES phase
> seemingly unnecessarily.
>
> Is there any way around this?
>
> Thanks,
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>