0 Replies Latest reply on Apr 26, 2013 4:26 PM by Gregory Androsov

    JSF a4j:commandLink isn't working after redirect

    Gregory Androsov Newbie

      Now I write my View presentor using JSF and have some troubles.

      I have 2 commandLinks which must change view (it will be realized later). They call redirect-method. Adress bar is chaged from "http://localhost:8080/frontoffice-jsf/main.jsf" "to http://localhost:8080/frontoffice-jsf/main.jsf#1".

      After that all two links are inactive (they actions are not called). What can I do? I need to use them more than 1 time.


      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                <a4j:commandLink value="view1" action="#{navigateBean.goToPlace}" render="out" execute="@form">
                          <f:param name="newPlace" value="np1" /> 
                <a4j:commandLink value="view2" action="#{navigateBean.goToPlace}" render="out" execute="@form">
                          <f:param name="newPlace" value="np2" /> 


      package ru.deltasolutions.jsf.navigate;
      import java.io.IOException;
      import java.io.Serializable;
      import javax.faces.bean.ManagedBean;
      import javax.faces.bean.ViewScoped;
      import javax.faces.context.ExternalContext;
      import javax.faces.context.FacesContext;
      public class NavigateBean implements Serializable {
                private static String path = "main.jsf";
                public void goToPlace() throws IOException {
                          ExternalContext ec = FacesContext.getCurrentInstance()
                          String add  = (String) ec.getApplicationMap().get("newPlace");
                          int i = 7;

      Please don't watch on String add - it isn't right. Just I tryed to debug it. Problem only in redirection