a4j:commandLink action on second click - again
atarifreak73 May 21, 2012 3:37 AMI know, there exists by now many many threads and posts in many communitys, and I have reseachred many days, but I found not the accurate solution. I have reduced the problem to the following codelines:
test_a.xhtml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:a4j="http://richfaces.org/a4j" xml:lang="en" lang="en" xmlns:h="http://java.sun.com/jsf/html"> <h:head /> <h:body> <h:form id="frm_a"> <h:outputText value="= A =" /> <h:panelGrid columns="1"> <h:column><a4j:commandLink action="to_c" execute="@this"> <h:outputText value="zu C" /> </a4j:commandLink></h:column> <h:column><a4j:commandLink action="to_b" execute="@this"> <h:outputText value="zu B" /> </a4j:commandLink></h:column> </h:panelGrid> </h:form> </h:body> </html>
2. Code:
test_b.xhtml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:a4j="http://richfaces.org/a4j" xml:lang="en" lang="en" xmlns:h="http://java.sun.com/jsf/html"> <h:head /> <h:body> <h:form> <h:outputText value="= B =" /> <h:panelGrid columns="1"> <h:column><a4j:commandLink action="to_c" execute="@this"> <h:outputText value="zu C" /> </a4j:commandLink></h:column> <h:column><a4j:commandLink action="to_a" execute="@this"> <h:outputText value="zu A" /> </a4j:commandLink></h:column> </h:panelGrid> </h:form> </h:body> </html>
test_c.xhtml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:a4j="http://richfaces.org/a4j" xml:lang="en" lang="en" xmlns:h="http://java.sun.com/jsf/html"> <h:head /> <h:body> <h:form> <h:outputText value="= C =" /> <h:panelGrid columns="1"> <h:column><a4j:commandLink action="to_a" execute="@this"> <h:outputText value="zu A" /> </a4j:commandLink></h:column> <h:column><a4j:commandLink action="to_b" execute="@this"> <h:outputText value="zu B" /> </a4j:commandLink></h:column> </h:panelGrid> </h:form> </h:body> </html>
a part of faces-config.xml:
... <navigation-rule> <from-view-id>/test_a.xhtml</from-view-id> <navigation-case> <from-outcome>to_b</from-outcome> <to-view-id>/test_b.xhtml</to-view-id> </navigation-case> <navigation-case> <from-outcome>to_c</from-outcome> <to-view-id>/test_c.xhtml</to-view-id> </navigation-case> </navigation-rule> ...
When I click to the navigationlinks, sometimes I must click several times to navigate to the desired page. It´s also by using actions in the managed beans. The first click wood be mostly ignored, but not always.
I´m using:
- JBoss 6.1 (with included JSF 2.0.3)
- Richfaces 4.2.2
I´m so thankful for any solutions!