users@javaserverfaces.java.net

Re: JSF, rendered attribute, backing bean method called repeatedly

From: Richard Bremner <richard.bremner.nb_at_googlemail.com>
Date: Tue, 18 Dec 2007 01:48:14 -0800 (PST)

They're in different backing beans...


Ryan Lubke wrote:
>
> Richard Bremner wrote:
>> No, sorry, the show method of all backing beans is called, and the call
>> to
>> all is repeated by the number of "rendered" tags.
>>
>> I'm not exactly new to JSF, but I must admit I don't understand the
>> lifecycle well enough to know what might be going on with the rendered
>> tag.
>> Maybe when it checks one, it has to check them all for some reason...
>>
> Well, the method will be queried each time it is referenced. The
> implementation
> won't cache the result of the evaluation of one expression as use that
> result for any
> other expressions if they happen to have the same literal text. The
> value could
> very well change between invocations on the same page.
>> Richard
>>
>>
>> Ryan Lubke wrote:
>>
>>> Richard Bremner wrote:
>>>
>>>> Hi,
>>>>
>>>> We are having some strange behaviour with our JSF (sun reference
>>>> implementation) application. I am running on Glassfish V2 final.
>>>>
>>>> say I have a page with the following panelGroup's, eg:
>>>>
>>>> <h:panelGroup rendered="BackingBean1.show">
>>>> ...
>>>> </h:panelGroup>
>>>>
>>>> <h:panelGroup rendered="BackingBean2.show">
>>>> ...
>>>> </h:panelGroup>
>>>>
>>>> <h:panelGroup rendered="BackingBean3.show">
>>>> ...
>>>> </h:panelGroup>
>>>>
>>>> Then, for instance, the "show" method in "BackingBean1" will be called
>>>> 3
>>>> times, as there are 3 "rendered" attributes. If I add a fourth, it will
>>>> be
>>>> called four times, if I remove them all but 2, it will be called twice,
>>>> if
>>>> there is only 1 "rendered" then the show method will be called only
>>>> once.
>>>> What on earth is causing this?
>>>>
>>>> cheers
>>>>
>>>> Richard
>>>>
>>>>
>>> Just to be clear, only BackingBean1.show is invoked in all cases even
>>> though
>>> you have specified BackingBean2.show or BackingBean3.show?
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
>>> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>>>
>>>
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: users-help_at_javaserverfaces.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/JSF%2C-rendered-attribute%2C-backing-bean-method-called-repeatedly-tp14272361p14389059.html
Sent from the javaserverfaces users mailing list archive at Nabble.com.