I build application with primefaces and use a commandbutton to call a rest service, in the method also redirect another page, in this page have a button with actionListener, but this doesn't execute the action.
The button in jsf after redirect (makeDevengo.jsf):
<p:commandButton value="View Devengo"
actionListener="#{devengosBean.showDevengo}">
</p:commandButton>
The initial button call (devengo.jsf):
<p:commandButton value="Make Devengo"
actionListener="#{devengosBean.newDevengo}">
</p:commandButton>
The first method :
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);
}
}
The method never call:
public void showDevengo(ActionEvent event) {
System.out.println("--->showDevengo");
}