On my registration screen I have 2 buttons: Save and Back . If I'm editing a record, the New button is enabled. My problem is when I click this New button the screen gives the refresh but what I want is to clear the data for a new one. A help please?
Method that fires when I click the button:
public void novo(){
if (nature == null){
nature = new Nature();
} else{
nature = null;
}
}
Button code:
<p:commandButton actionListener="#{habilidademb.novo}" value="Novo" ajax="false" update="cadastro" rendered="#{naturemb.nature.id != null}" styleClass="separadorBotoes"/>