CommandButton Primefaces does not call method

1

My commandbutton shows no error when clicking, but does not execute the method either.

Commandbutton code:

p:commandButton action="#{clienteMB.cliente.Salvar}" value="Incluir"/

Method code:

public void Salvar(){
        System.out.println("Funcionou...);
}

Using apache tomcat worked fine, but in glassfish it has no results and no errors. Can anyone help me?

    
asked by anonymous 29.08.2015 / 14:50

1 answer

2

When using action or actionListener :

action is used when you will perform action / nagevation. Your method needs to return a String with the next destination or return null to remain on the same screen.

actionListener is used to change components or state of some object, for example, execute a method and then update a table.

Try this:

<p:commandButton actionListener="#{clienteMB.cliente.Salvar}" process="@this" value="Incluir"/>
    
29.08.2015 / 17:04