The "javax.faces.source" parameter does not appear when I use the update="# {mainControle.updateAlterarCadastroGenerico}" tag in a p: commandButton

0

I am using PhaseListener to validate user permission. And when I use the Update tag with biding I can not see the javax.faces.source parameter in the request.

HTML that works:

<p:commandButton actionListener="# cadastroGenericoControle.alterarCadastroGenerico}" >
</p:commandButton>

HTML that does not work:

p:commandButton  update="#{principalControle.updateAlterarCadastroGenerico}"
    actionListener="#{cadastroGenericoControle.alterarCadastroGenerico}" >
</p:commandButton>

Java code

public void afterPhase(PhaseEvent event) {

    Map<String, String> params =event.getFacesContext().getExternalContext().getRequestParameterMap();

    boolean achouParametro = params.containsKey("javax.faces.source");

    ***quando não utilizo 'update="# principalControle.updateAlterarCadastroGenerico}"' no botão, a variável 'achouParametro' está 'true', e quando utilizo está 'false'.*** 

}
    
asked by anonymous 29.11.2017 / 19:09

1 answer

0

The error was caused because you were using "@ (:" to update the component.

Code that caused the error

public String getUpdateAlterarCadastroGenerico(){
        return "@(:panelPesquisar),@(:panelAlterar)";
}

Code that corrected the error

public String getUpdateAlterarCadastroGenerico(){
        return "panelPesquisar,panelAlterar";
}
    
30.11.2017 / 17:12