Hi, I am using MyFaces-core-1.2.7 + Tomahawk12-1.1.9 on Apache Tomcat 6.0.18 . I wanted to use JSCookMenu. Everything looks fine, it is navigating properly according to faces-config.xml settings. But! actionListener does not work at all, the action listener is not called, and I get no exceptions. The Bean is properly registered as well and has session scope. When I used a separated jsp page to set language and I used a command button to call the changeLocale method as action, it was working and still works properly. Only the changeListener method never called....
Could you help me please what I am failing? Kind regards: Pal Sources: relevant part of the JSP: ------------------------------------------------------------------------------------------------------- <c:subview id="topMenu"> <f:form> <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="css/jscookmenu"> <t:navigationMenuItem id="mnuSystem" itemLabel="#{msgs.mnu_system}"> <t:navigationMenuItem id="mnuLogin" itemLabel="#{msgs.mnu_system_login}" action="login" rendered="#{loginBean.loggedIn ? 'false' : 'true'}" /> <t:navigationMenuItem id="mnuLogoff" itemLabel="#{msgs.mnu_system_logoff}" action="logoff" rendered="#{loginBean.loggedIn ? 'true' : 'false'}" /> </t:navigationMenuItem> <t:navigationMenuItem id="mnuSetup" itemLabel="#{msgs.mnu_setup}" rendered="#{loginBean.loggedIn ? 'true' : 'false'}"> <t:navigationMenuItem id="mnuSetupData" itemLabel="#{msgs.mnu_setup_chdata}" action="register" /> <t:navigationMenuItem id="mnuChpass" itemLabel="#{msgs.mnu_setup_chpass}" action="chpass" /> </t:navigationMenuItem> <t:navigationMenuItem id="mnuRegister" itemLabel="#{msgs.mnu_register}" action="register" rendered="#{loginBean.loggedIn ? 'false' : 'true'}" /> <t:navigationMenuItem id="mnuInfo" itemLabel="#{msgs.mnu_info}"> <t:navigationMenuItem id="mnuInfoThis" itemLabel="#{msgs.mnu_info_aboutthis}" action="aboutthis" /> <t:navigationMenuItem id="mnuInfoTP" itemLabel="#{msgs.mnu_info_abouttp}" action="showhome" /> </t:navigationMenuItem> <t:navigationMenuItem id="mnuLang" itemLabel="#{msgs.mnu_lang}"> <t:navigationMenuItem id="mnuLangEN" itemValue="en" actionListener="#{localeBean.changeListener}" itemLabel="#{msgs.mnu_lang_en}" action="welcome" /> <-- **** ACTION LISTENER LINE **** --> <t:navigationMenuItem id="mnuLangHU" itemValue="hu" actionListener="#{localeBean.changeListener}" itemLabel="#{msgs.mnu_lang_hu}" action="welcome" /> <-- **** ACTION LISTENER LINE **** --> </t:navigationMenuItem> </t:jscookMenu> </f:form> </c:subview> ------------------------------------------------------------------------------------------------------------ The java method should be called: ------------------------------------------------------------------------------------------------------------ package mypackage; import java.util.Locale; import javax.faces.event.ActionEvent; import org.apache.myfaces.custom.navmenu.jscookmenu.HtmlCommandJSCookMenu; /** * * @author FulajtarP */ public class LocaleBean { private String locale = Locale.getDefault().getLanguage(); public void setLocale(String locale) { this.locale = locale; } public String getLocale() { return this.locale; } public String changeLocale() { return "langchanged"; } public void changeListener(javax.faces.event.ActionEvent event) { String inData = (String)((HtmlCommandJSCookMenu) event.getComponent()).getValue(); this.locale = inData; } }
A(z) kimenõ üzenetben nem található vírus. Ellenõrizte: AVG - www.avg.com Verzió: 9.0.656 / Vírus adatbázis: 271.1.1/2388 - Kiadás dátuma: 09/22/09 07:51:00
A(z) kimenő üzenetben nem található vírus. Ellenőrizte: AVG - www.avg.com Verzió: 9.0.656 / Vírus adatbázis: 271.1.1/2389 - Kiadás dátuma: 09/22/09 19:54:00