1 Reply Latest reply on Oct 15, 2007 9:12 AM by 3of10

    context.getViewRoot().setLocale(locale) and h:commandLinks

    3of10

      Hello community,

      i have a problem with setting up the locale in my application. currently i use Facescontext.getViewRoot().getCurrentInstance().setLocale(locale) for setting up the locale. it works, but just in my initial view root.

      the problem is that i have some other links without ajax-support (like h:outputLink). if i press some of that links the locale setup is resetet to initial language.

      i am not sure is this is a bug and how can i set up locale for complete session. i tryed some code thinks like following:

      HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
      session.setAttribute(Globals.LOCALE_KEY, locale);
      session.setAttribute("locale", locale);
      context.getExternalContext().getSessionMap().put("locale", locale);

      no success. ;-(

      i use templates btw, possible is that the problem?

      <ui:composition template="/pages/template/main.xhtml">
      <ui:define name="header">
      <ui:include src="/pages/include/header.xhtml"></ui:include>
      </ui:define>
      <ui:define name="body">
      <f:view>
      ..........
      </f:view>
      </ui:define>
      </ui:composition>

      kind regards,
      marco f.