1 Reply Latest reply on Aug 22, 2008 9:52 AM by Mikael Andersson

    Language Selector - workaround needed as I don't have a command button

    John Skillings Newbie

      We are building an internationalized application, and are currently using Seam's built-in components for handling the I18N features. The list of all the supported locales are defined in faces-config.xm.

      We have a drop down list (combo box) and code is as follows:

      <h:selectOneMenu value="#{localeSelector.localeString}">
          <f:selectItems value="#{localeSelector.supportedLocales}"/>

      Because of UI design mandates, I don't have a command button to select the language, and my requirement is that just by selecting the item from drop down, the language switch should be made effective.

      The Seam manual indicates that you need to add a command button, next to the language selection drop down list to switch the language.

      <h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/>

      My question is that given I don't have a command button, how could I switch the language just by selecting item from the drop down list?

      Can I do this through an ajax action?

      Any ideas on workarounds is appreciated.

      Thank you.