I got this error:
execute="#{localeManager.changeLocale}": Property 'changeLocale' not found on type xyz.com.i18n.LocaleManager
where LocaleManager is:
@ManagedBean
@ViewScoped
public class LocaleManager implements Serializable
{
// other codes here
public static void changeLocale(AjaxBehaviorEvent event) {
newLocale = (Locale) new Locale((String) event.toString());
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("selectedLocale", newLocale);
}
}
and I'm calling the bean's method here:
<h:selectOneMenu id="selectLang" immediate="true" value="#{langListing.language}">
<f:ajax event="change" execute="#{localeManager.changeLocale}" />
<f:selectItems value="#{langListing.languages}" />
</h:selectOneMenu>
I'm learning AJAX by experimenting with this code. But I don't understand how Ajax evaluates bean's method. Is this a straightforward issue to resolve?