2016-03-30 20 views
0

Primefaces ile uygulama yapıyorum ve bir dinlenme servisi çağırmak için bir komut düğmesi kullanın, bu yöntemde başka bir sayfaya yönlendirme de, bu sayfada actionListener ile bir düğme var, ancak bu eylemi yürütmüyor .Primefaces: actionListener çalışmıyor

yönlendirme (makeDevengo.jsf) sonra jsf düğmesini:

<p:commandButton value="View Devengo" 
          actionListener="#{devengosBean.showDevengo}"> 
         </p:commandButton> 

ilk düğmesi çağrısı (devengo.jsf):

<p:commandButton value="Make Devengo" 
        actionListener="#{devengosBean.newDevengo}"> 
       </p:commandButton> 

Birinci yöntem:

public void newDevengo(ActionEvent event) { 



    try { 

     // Rest call 
     //Redirection 

     ExternalContext ec = context.getExternalContext(); 
     ec.redirect("/myPath/makeDevengo.jsf"); 
     return; 



    } catch (Exception e) { 
     context.addMessage(null, new FacesMessage(
       FacesMessage.SEVERITY_ERROR, "Error", 
       "Make devengo problem)); 
     LOGGER.error(e); 
    } 

} 

Bu yöntem hiçbir zaman arayabilir:

public void showDevengo(ActionEvent event) { 

    System.out.println("--->showDevengo"); 
} 

cevap

0

Kesme noktası koyduğunuzda, commandButton yöntemini tetiklemediğinden emin olun. İkinci komut düğmesinin bir formda olduğundan emin olun. Güncelleme yan tümcesi eklemeye çalışın. Eğer hala çalışmıyorsa, bütün kodlarınızı paylaşın.