Fwd: string-binding problem
Simon Robins <[email protected]> Wed, 15 Jan 2003 19:12:52 +0000
| Newsgroups | gmane.comp.java.tapestry.devel |
|---|---|
| Message-ID | <[email protected]> |
> From: Simon Robins <[email protected]> > Date: Wed Jan 15, 2003 7:12:13 pm Europe/London > To: Christian Sell <[email protected]> > Subject: Re: [Tapestry-developer] string-binding problem > > You need to do this in the action that responds to the select > component when the locale is changed rather than allowing the page to > re-render itself. > > Read the Page Localisation section of Chapter 4 of the Developers > Guide for an explanation of why. > > Regards, > > Simon > > On Wednesday, January 15, 2003, at 05:53 pm, Christian Sell wrote: > >> erm, sorry, but I am not with you. Do you suggest this as a >> workaround for the (otherwise quite simple) thing I am doing? And >> where do you suggest this code to be located? >> >> It still seems to me that this is more a case for the bugtracker than >> for the FAQ. Correct me if I am wrong.. >> >> >> Simon Robins wrote: >>> Maybe this problem should be in the FAQ. >>> You need to do something like this: >>> IEngineService pageService = >>> cycle.getEngine().getService(IEngine.PAGE_SERVICE); >>> Gesture gesture = pageService().buildGesture(cycle, null, new >>> String[] { getPage().getName() } ); >>> throw new RedirectException(gesture.getAbsoluteURL()); >>> Regards, >>> Simon >>> On Wednesday, January 15, 2003, at 05:10 pm, Christian Sell wrote: >>>> could somebody confirm that the issue described below is a bug? >>>> Should I enter it into the bug tracker? >>>> >>>> As it turns out, the only way to get around this is to change the >>>> application design to be like the workbench demo, where after >>>> changing the locale the user is directed to another page. If >>>> instead you want to redisplay the same page, it will not show the >>>> new localization. >>>> >>>> regards >>>> >>>> Christian Sell wrote: >>>> >>>>> to answer my question regarding a workaround: >>>>> I tried this: >>>>> <binding name="value" expression='getString("message")'/> >>>>> this forced the binding to be evaluated every time - BUT: >>>>> The string table for the component is created lazily based on the >>>>> current locale and cached afterward. It is NOT recreated if the >>>>> locale changes, and therefore wrong if the same component is >>>>> reused in a subsequent request. See method >>>>> AbstractComponent.getString(String key). >>>>> it seems I cannot proceed without hacking tapestry - or >>>>> redesigning my app >>>>> Christian >>>>> Christian Sell wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> On one of my pages, I am using an Insert component with a >>>>>> string-binding parameter. On the same page, I have a form with a >>>>>> Select component which allows setting the Locale. After setting >>>>>> the locale, the same page is redisplayed. >>>>>> >>>>>> Now it turns out that when the locale is set, the Insert element >>>>>> does not change its appearance according to the new locale. Only >>>>>> after visiting another page and returning to the previous one, >>>>>> the new localized string is shown. >>>>>> >>>>>> I went to the source code and discovered that string-bindings are >>>>>> only evaluated once when the component is first created - in >>>>>> method ParameterManager.setup(IRequestCycle cycle). It seems that >>>>>> when the same page is redisplayed after changing the locale, this >>>>>> does not happen. >>>>>> >>>>>> I consider this a bug. My suggestion is that >>>>>> StringBinding.isInvariant() should return false, and not true as >>>>>> is currently the case. >>>>>> >>>>>> objections? Or is there a workaround? >>>>>> >>>>>> Christian >>>>>> >>>>>> >>>>>> >>>>>> ------------------------------------------------------- >>>>>> This SF.NET email is sponsored by: FREE SSL Guide from Thawte >>>>>> are you planning your Web Server Security? Click here to get a >>>>>> FREE >>>>>> Thawte SSL guide and find the answers to all your SSL security >>>>>> issues. >>>>>> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en >>>>>> _______________________________________________ >>>>>> Tapestry-developer mailing list >>>>>> [email protected] >>>>>> https://lists.sourceforge.net/lists/listinfo/tapestry-developer >>>>>> >>>>> ------------------------------------------------------- >>>>> This SF.NET email is sponsored by: Take your first step towards >>>>> giving your online business a competitive advantage. Test-drive a >>>>> Thawte SSL certificate - our easy online guide will show you how. >>>>> Click here to get started: >>>>> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en >>>>> _______________________________________________ >>>>> Tapestry-developer mailing list >>>>> [email protected] >>>>> https://lists.sourceforge.net/lists/listinfo/tapestry-developer >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.NET email is sponsored by: Take your first step towards >>>> giving your online business a competitive advantage. Test-drive a >>>> Thawte SSL certificate - our easy online guide will show you how. >>>> Click here to get started: >>>> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en >>>> _______________________________________________ >>>> Tapestry-developer mailing list >>>> [email protected] >>>> https://lists.sourceforge.net/lists/listinfo/tapestry-developer >>>> >> >> >> >> >> ------------------------------------------------------- >> This SF.NET email is sponsored by: A Thawte Code Signing Certificate >> is essential in establishing user confidence by providing assurance >> of authenticity and code integrity. Download our Free Code Signing >> guide: >> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en >> _______________________________________________ >> Tapestry-developer mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/tapestry-developer >> > ------------------------------------------------------- This SF.NET email is sponsored by: A Thawte Code Signing Certificate is essential in establishing user confidence by providing assurance of authenticity and code integrity. Download our Free Code Signing guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en