-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I use this spring bean in my jsf pages to do the traductions.
<bean id="msgs" name="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="defaultEncoding" value="UTF-8"/> <property name="fileEncodings" value="UTF-8"/> <property name="basenames"> <ref bean="myMessageFiles" /> </property> </bean>
<h:outputText value="#{msgs.telefono}" />
I try to do something similar in a zul file but i cann't, the code...
<zk> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> .... .... <toolbarbutton id="startButton" image="/img/inicioicon.gif" onClick="...." tooltiptext="${msgs.inicio}"/>
It doesn work, unable to find the propertie inicio.
it is possible to do something similar in zul files?
The way you did it is correct. The variable resolver have found the msgs bean. However, EL is somehow limited. It needs a getter (getInicio()) to fetch the inicio attribute. This is the limitation of the EL.
Thank for four response Henri, it helped me
Finally it works with this code
<zk> <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> .... .... <toolbarbutton id="startButton" image="/img/inicioicon.gif" onClick="..." tooltiptext=""/> <zscript> org.springframework.context.support.ReloadableResourceBundleMessageSource message = (org.springframework.context.support.ReloadableResourceBundleMessageSource)msgs; startButton.setTooltiptext(message.getMessage("inicio",null,Locale.getDefault())); </zscript>
Thanks
Asked: 2008-11-05 12:18:21 +0800
Seen: 312 times
Last updated: Nov 06 '08