Still need to create the issue - but i've got an idea for a workaround. How about a viewhandler, which uses a custom session bean which holds the locale - and which return this one when "calculateLocale" is called?
Something like this:
public Locale calculateLocale(FacesContext facesContext) {
LanguageBean neededBean
= (LanguageBean) facesContext.getApplication()
.getVariableResolver().resolveVariable(facesContext,
"language");
if(neededBean != null) {
log.info("current locale -> " + neededBean.getCurrentLanguage());
return neededBean.getCurrentLocale();
}
log.info("current locale -> " + base.calculateLocale(facesContext));
return base.calculateLocale(facesContext);
}
Any drawbacks of this workaround?
Torsten
Am Donnerstag, den 19.10.2006, 16:20 +0000 schrieb Gary VanMatre:
> >From: Torsten Krah <[EMAIL PROTECTED]>
> >
> > The solution with metadata inheritance sounds very nice. It would fit
> > very well in the way things works now, if would prefer this way - but
> > maybe there are any drawbacks i don't see, but in my opinion,
> > inheritance for the view root would be fine.
> >
> > Torsten
> >
> > ps: I will try the workarounds and post if they work ( i guess they
> > do ).
> >
>
> This will actually take a little bit of coding because Clay doesn't create
> the view root. The view handler does this and clay is added as the only
> child of the view root when not used in JSP.
>
> I was thinking we could just filter out and save away any component
> definitions associated with the view root and then apply them to the root
> after the tree was build.
>
> Torsten, could you create a JIRA request on this one?
>
> Thanks,
> Gary
>
>
> > Am Mittwoch, den 18.10.2006, 15:38 +0000 schrieb Gary VanMatre:
> > > >From: Torsten Krah
> > > >
> > > > But this makes the assumption that the browsers preferences are used (
> > > > i
> > > > dont want to make views for every language, one view for all - which
> > > > changes lang according to a property ).
> > > > But i want to use a locale which is "fixed" until a property changes -
> > > > this must be bound to the rootView ( f:view ).
> > > >
> > >
> > > Well, you could bind a hidden attribute to a backing bean and set the
> > > local of
> > the view root there by way of the facesContext. Or, you might be able to
> > set
> > the local of the view root in the shale view controller's prerender
> > callback.
> > >
> > > However, I agree that this is something missing in Clay. JSF 1.2 adds a
> > couple important attributes to the view root that we will want to support
> > besides the locale.
> > >
> > > renderKitId, beforePhaseListener, afterPhaseListener
> > >
> > > Clay has a couple comment directives:
> > >
> > >
> > >
> > >
> > >
> > > What if we added another for the view root?
> > >
> > >
> > >
> > > However, if we made it a base component definition, we could take
> > > advantage of
> > the metadata inheritance.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > And, then use it in HTML.
> > >
> > >
> > >
> > > Or, we could do something like this:
> > >
> > >
> > > What do you think?
> > >
> > > Gary
> > >
> > >
> > > > In JSP thats no problem, but where to est this in xml/html views?
> > > >
> > > > Torsten
> > > >
> > > > Am Mittwoch, den 18.10.2006, 12:58 +0200 schrieb
> > > > [EMAIL PROTECTED]:
> > > > > Hi
> > > > >
> > > > > In html/xml views, this is handled by you in your backing beans, and
> > > > > when
> > > > using resourcebundles by the message tag
> > > > >
> > > > > Hermod
> > > > >
> > > > > -----Original Message-----
> > > > > From: Torsten Krah [mailto:[EMAIL PROTECTED]
> > > > > Sent: Wednesday, October 18, 2006 12:54 PM
> > > > > To: [email protected]
> > > > > Subject: Clay - how to set locale Parameter for f:view in html/xml
> > > > > views?
> > > > >
> > > > >
> > > > > Is there a way to set the locale of the viewRoot?
> > > > >
> > > > > In the jsp:
> > > > >
> > > > >
> > > > > ...
> > > > >
> > > > >
> > > > > does the job.
> > > > >
> > > > > But where to do this in clay html/xml views?
> > > > >
> > > > > Torsten
> > > > >
> > > > >
> > > > >
> > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> > > > > * *
> > *
> > > > >
> > > > > This email with attachments is solely for the use of the individual
> > > > > or
> > > > > entity to whom it is addressed. Please also be aware that the DnB NOR
> > Group
> > > > > cannot accept any payment orders or other legally binding
> > > > > correspondence
> > with
> > > > > customers as a part of an email.
> > > > >
> > > > > This email message has been virus checked by the anti virus programs
> > > > > used
> > > > > in the DnB NOR Group.
> > > > >
> > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> > > > > * *
> > *
> > > > >
> > > >
> >
smime.p7s
Description: S/MIME cryptographic signature
