A4J:Form and Navigation-Rule problem
karam Aug 26, 2009 6:20 PMHi,
i use
<a4j:form ajaxsubmit="true"> for a login Panel.
My Problem:
See Pic 1
http://www.db-itech.de/pic1.jpg
If i click there to Mitglied werden my navigation-rule works perfect.
But if i click to Einloggen ( see Pic2 )
http://www.db-itech.de/pic2.jpg
and then to ausloggen ( see Pic 3 ) then the navigation-rule doesn't work.
[img]
http://www.db-itech.de/pic3.jpg
[/img]
My JSF for the Login Panel
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <rich:panel id="loginPanel"> <f:facet name="header"> <h:outputText value="Login" /> </f:facet> <h:panelGrid id="login" width="100%"> <h:panelGroup rendered="#{loginBean.userOnline}"> <h:panelGrid width="100%"> <h:panelGroup> <h:panelGrid width="100%"> <h:form id="test2"> <h:commandLink value="Mein Postfach" action="goToMessages" styleClass="commandLink"/> </h:form> <rich:separator width="100%"/> <a4j:commandLink value="Mein Profil" styleClass="commandLink"/> <rich:separator width="100%"/> <a4j:commandLink value="Meine Kontakte" styleClass="commandLink"/> <rich:separator width="100%"/> <rich:spacer width="1" height="10" /> <a4j:form reRender="loginPanel" ajaxSubmit="true" id="logoutA4JForm"> <h:commandButton value="Ausloggen" styleClass="button"> <a4j:support event="onclick" action="#{loginBean.logout}" /> </h:commandButton> </a4j:form> </h:panelGrid> </h:panelGroup> </h:panelGrid> </h:panelGroup> <h:panelGroup rendered="#{!loginBean.userOnline}"> <h:panelGrid width="100%"> <h:panelGroup> <a4j:form reRender="loginPanel" ajaxSubmit="true" id="loginA4JForm"> <h:panelGrid width="100%"> <h:outputLabel id="loginNickname" value="Nickname" /> <h:inputText label="loginNickname" value="#{loginBean.nickname}"> </h:inputText> </h:panelGrid> <h:panelGrid width="100%"> <h:outputLabel id="loginPassword" value="Passwort" /> <h:inputSecret label="loginPassword" value="#{loginBean.password}"> </h:inputSecret> </h:panelGrid> <rich:spacer width="1" height="10" /> <h:panelGrid width="100%" > <h:commandButton value="Einloggen" styleClass="button"> <a4j:support event="onclick" action="#{loginBean.login}" /> </h:commandButton> </h:panelGrid> </a4j:form> <rich:spacer width="1" height="10" /> <rich:separator width="100%"/> <h:panelGrid width="100%"> <h:form id="test1"> <h:commandLink value="Mitglied werden?" action="goToRegistration" styleClass="commandLink"/> </h:form> <rich:separator width="100%"/> <a4j:commandLink value="Passwort vergessen?" styleClass="commandLink"/> <rich:separator width="100%"/> </h:panelGrid> </h:panelGroup> </h:panelGrid> </h:panelGroup> </h:panelGrid> </rich:panel>
My Navigation Rule on Faces-config
<navigation-rule> <display-name>login</display-name> <from-view-id>*</from-view-id> <navigation-case> <from-outcome>goToRegistration</from-outcome> <to-view-id>/registration.jsp</to-view-id> <redirect /> </navigation-case> </navigation-rule>
if i don't use the ajaxsubmit="true" then it works....