JSF Primefaces selectonemenu page navigation

后端 未结 2 544
闹比i
闹比i 2021-01-28 11:57

I am developing a web application using JSF and Primefaces. I want o show the following menu and depending on the choosen option go to one page or another.

XHTML code:

2条回答
  •  粉色の甜心
    2021-01-28 12:53

    You might process the value of car via an AJAX call and redirect the response from your bean class.

    
            
            
            
    
    

    And within your bean class something like

      public void someAction() {
            String location = "page"+car+".xhtml";
            FacesContext.getCurrentInstance()
                .getExternalContext()
                .redirect(location)
            ;
        }
    }
    

提交回复
热议问题