Foros de discusión

liferay el variable isn't resolved

Pierluca Marino, modificado hace 9 años.

liferay el variable isn't resolved

Junior Member Mensajes: 27 Fecha de incorporación: 15/11/10 Mensajes recientes
Hi,

After upgrading mojarra 2.1.29 and bridge 3.1.4 ga5 the liferay managed bean and used as el variable isn't resolved anymore. Trying to explain, in our portlet we user notation #{liferay.user.locale} to pass current liferay user locale to primefaces calendar tag. Es:

<p:calendar id="idDataRicercaDal" value="#{toDoListLogModelBean.dataLogDa}" showon="button" pattern="#{m3i18n['formato.data.default']}" styleclass="m3CalendarVerdeObbligatorio" showothermonths="true" selectothermonths="true" converter="#{XmlGregorianCalendarConverter}" disabledweekends="true" binding="#{idDataRicercaDal}" locale="#{liferay.user.locale}" navigator="true" yearrange="#{m3i18n['range.anni.calendario.futuro']}"></p:calendar>


Now after upgrading #{liferay.user.locale} return empty value, but neither #{liferay.user} and #{liferay} return empty values.

Thanks for any help.

Pierluca

P.S. We user Liferay 6.1.3 ga3
thumbnail
Neil Griffin, modificado hace 9 años.

RE: liferay el variable isn't resolved

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Pierluca,

If I remember correctly, the User.getLocale() method returns the locale that has been saved by the user when he edits his profile. If I am correct, then perhaps the user has not saved a different locale from his profile?

Are you trying to determine the current locale? That should be set automatically for you by the LiferayLocalePhaseListener, which gets the user's locale from the ThemeDisplay and sets it in the ViewRoot.

Kind Regards,

Neil
Pierluca Marino, modificado hace 9 años.

RE: liferay el variable isn't resolved

Junior Member Mensajes: 27 Fecha de incorporación: 15/11/10 Mensajes recientes
Hi Neil,

Now i get locale from object ViewRoot:

<p:calendar id="calendarioRicerca" value="#{toDoListModelBean.dataRicercaAl}" showon="button" pattern="#{m3i18n['formato.data.default']}" styleclass="m3CalendarVerde" showothermonths="true" selectothermonths="true" converter="#{XmlGregorianCalendarConverter}" disabledweekends="true" binding="#{calendarioRicerca}" locale="#{view.locale.language}" < code></p:calendar>
<br><br>and it works.<br><br>Thank you very much.<br><br>Pierluca
thumbnail
Neil Griffin, modificado hace 9 años.

RE: liferay el variable isn't resolved

Liferay Legend Mensajes: 2655 Fecha de incorporación: 27/07/05 Mensajes recientes
Hi Pierluca,

I'm glad it is working for you now. Alternatively you can use #{liferay.themeDisplay.locale}

Kind Regards,

Neil