I don't think so, the values in your db can change whenever you want,
that's why the value is evaluated at each request of 'getValue'. But
your proposed change to UISelectItem would break it :)

En l'instant précis du 25/05/07 10:50, [EMAIL PROTECTED]
s'exprimait en ces termes:
> Sorry, change should with could...
>
> Could be a problem if the list of values changed between encodeBegin and 
> encodeEnd phase?
>
> Mario 
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 25 maggio 2007 10.35
> To: users@myfaces.apache.org
> Subject: RE: Don't understand getValue code of UISelectItems
>
> Should be a problem if the list of values changed between encodeBegin and 
> encodeEnd phase? 
>
> Mario
>
> -----Original Message-----
> From: David Delbecq [mailto:[EMAIL PROTECTED] 
> Sent: 25 maggio 2007 10.24
> To: MyFaces Discussion
> Subject: Re: Don't understand getValue code of UISelectItems
>
> Hi Mario,
>
> En l'instant précis du 25/05/07 09:36, [EMAIL PROTECTED]
> s'exprimait en ces termes:
>   
>> Hi, i'm looking the method getValue() of UISelectItems:
>>
>>  
>>
>>     public Object getValue()
>>
>>     {
>>
>>         if (_value != null) return _value;
>>
>>         ValueBinding vb = getValueBinding("value");
>>
>>         return vb != null ? vb.getValue(getFacesContext()) : null;
>>
>>     }
>>
>>  
>>
>> And I see that if a value property of the SelectItemsTag is setted
>> with a ValueBinding format, then every time I get getValue() the value
>> is rebuilded.
>>
>>     
> Correct
>   
>> This could be a problem for example in the case I have a property
>> value of my managed bead used for value binding that access to DB to
>> return the result, because in the life cycle of a page, this
>> getValue() is called more than one time. My question  is:
>>
>> Why the getValueBinding("value") result is not cached? For example:
>>
>>  
>>
>>  
>>
>>     private Object _vb=null;
>>
>>     private boolean  vbCalculated=false;
>>
>>  
>>
>>     public Object getValue()
>>
>>     {
>>
>>         if (_value != null) return _value;
>>
>>         if(!vbCalculated) {
>>
>>              ValueBinding moment = getValueBinding("value");
>>
>>              _vb= moment.getValue(getFacesContext());
>>
>>              vbCalculated=true;
>>
>>         }
>>
>>         return _vb;
>>
>>     }
>>
>>  
>>
>>  
>>
>> Ciao
>>
>> Mario
>>
>>     
> Let's assume it does it and does not break JSF specification (am sure it
> would). Because there is no method specified in JSF api, which myface
> must respect, to 'invalidate calculated valuebinding', how can your
> application tell all select items of the form that the list of values
> changed between the validation and the render phase?
> You demonstrated how easy it is to cache a value result, then just do it
> in your backing bean and you performance problem is solved. There is no
> reason to do that in the jsf itself. JSF does what is told to it, use a
> "dynamic" value :)
>   
>> This message is for the designated recipient only and may contain
>> privileged, proprietary, or otherwise private information. If you have
>> received it in error, please notify the sender immediately and delete
>> the original. Any other use of the email by you is prohibited.
>>
>>     
> Useless disclaimer when posting to mailing list ^-^
>
> Regards,
> David
>
>
>
> This message is for the designated recipient only and may contain privileged, 
> proprietary, or otherwise private information.  If you have received it in 
> error, please notify the sender immediately and delete the original.  Any 
> other use of the email by you is prohibited.
>
>
> This message is for the designated recipient only and may contain privileged, 
> proprietary, or otherwise private information.  If you have received it in 
> error, please notify the sender immediately and delete the original.  Any 
> other use of the email by you is prohibited.
>   

Reply via email to