voyent
<f:view locale=""> attribute not evaluates to string  XML
Forum Index -> General Help
Author Message
abhisheksinha

Joined: 24/Apr/2008 00:00:00
Messages: 15
Offline


Iam developing an application of changing locale but whenever iam writing <f:view locale="#{beanname.locale}" its throwing an exception attribute doesnot evaluate to be sting or null but if i write locale="en" its working fine.
In my bean class locale is declared as string of modifier private.
Please do post ur valuable comments.
qpid

Joined: 09/Nov/2007 00:00:00
Messages: 21
Offline


Hello abhisheksinha,

the locale attribute of f:view expects an object of type java.util.Locale.

I use the following code (found in this forum) to offer dynamic changing locale:

main.jspx/xhtml
Code:
<f:view locale="#{localeBean.locale}">
 	<f:loadBundle basename="ApplicationMessages" var="bundle" />
 ...
 <ice:selectOneMenu value="#{localeBean.selectedLocale}"
 					partialSubmit="true">
 					<f:selectItems value="#{localeBean.locales}" /></ice:selectOneMenu>
 


LocaleBean.java is attached.

regards qpid
 Filename LocaleBean.java [Disk] Download
 Description backing bean for manage locales
 Filesize 1 Kbytes
 Downloaded:  786 time(s)

abhisheksinha

Joined: 24/Apr/2008 00:00:00
Messages: 15
Offline


Thanks for replying to the post..
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team