You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by kindsol <ki...@hotpop.com> on 2007/06/19 23:50:27 UTC

Sandbox convertDateTime doesn't reload the timezone

It is my understanding that the standard JSF tag <f:convertDateTime>  
only loads the timeZone attribute once per session.

In my application, I allow my users to change their default timezone,  
however, due the the behavior stated above, my users need to logout  
then back in to see the timezone change take place.

I read (somewhere) that by creating a custom converter tag the  
attributes can (will?) be reloaded every refresh.  Seeing that there  
is a custom <s:convertDateTime> tag in the sandbox, I got that  
running -- but I am seeing the same behavior.

Any ideas on how to force the timezone Attribute to be re-read on a  
page refresh?

-Sol



Re: Sandbox convertDateTime doesn't reload the timezone

Posted by kindsol <ki...@hotpop.com>.
I had no luck with a custom converter which dynamically reads it's  
attributes in the getAsString() method call.  I could only get the  
attributes for the converter to be read once -- if the attribute  
values changed, the converter would not notice (which I think is a  
serious limitation)

Just in case someone stumbles on this thread, I implemented the  
following solution which programatically associates a converter with  
a UIComponent:

http://www.nabble.com/Re%3A-Dynamic-Converter-p454911.html

Hope this helps someone in the future.

-Sol


On Jun 19, 2007, at 5:24 PM, kindsol wrote:

> After digging around in the source code, the mailing list and some  
> books, it looks like I need to override the getAsString() method of  
> this converter, read the timeZone attribute from the converter, and  
> explicitly set the timeZone instance variable in the  
> <s:convertDateTime> converter.
>
> I know how to get component attributes via valueBinding.  Is it  
> possible to get attributes of a converter in the getAsString() method?
>
> Does anyone have an example?
>
> -Sol
>
>
> On Jun 19, 2007, at 2:50 PM, kindsol wrote:
>
>> It is my understanding that the standard JSF tag  
>> <f:convertDateTime> only loads the timeZone attribute once per  
>> session.
>>
>> In my application, I allow my users to change their default  
>> timezone, however, due the the behavior stated above, my users  
>> need to logout then back in to see the timezone change take place.
>>
>> I read (somewhere) that by creating a custom converter tag the  
>> attributes can (will?) be reloaded every refresh.  Seeing that  
>> there is a custom <s:convertDateTime> tag in the sandbox, I got  
>> that running -- but I am seeing the same behavior.
>>
>> Any ideas on how to force the timezone Attribute to be re-read on  
>> a page refresh?
>>
>> -Sol
>>
>>
>


Re: Sandbox convertDateTime doesn't reload the timezone

Posted by kindsol <ki...@hotpop.com>.
After digging around in the source code, the mailing list and some  
books, it looks like I need to override the getAsString() method of  
this converter, read the timeZone attribute from the converter, and  
explicitly set the timeZone instance variable in the  
<s:convertDateTime> converter.

I know how to get component attributes via valueBinding.  Is it  
possible to get attributes of a converter in the getAsString() method?

Does anyone have an example?

-Sol


On Jun 19, 2007, at 2:50 PM, kindsol wrote:

> It is my understanding that the standard JSF tag  
> <f:convertDateTime> only loads the timeZone attribute once per  
> session.
>
> In my application, I allow my users to change their default  
> timezone, however, due the the behavior stated above, my users need  
> to logout then back in to see the timezone change take place.
>
> I read (somewhere) that by creating a custom converter tag the  
> attributes can (will?) be reloaded every refresh.  Seeing that  
> there is a custom <s:convertDateTime> tag in the sandbox, I got  
> that running -- but I am seeing the same behavior.
>
> Any ideas on how to force the timezone Attribute to be re-read on a  
> page refresh?
>
> -Sol
>
>