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

Asked

Viewed 37 times

0

I’m using PhaseListener to validate user permission. And when I use the Update tag with biding I cannot view the parameter javax.faces.source 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`.*** 

}

1 answer

0

The error was caused because it was 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";
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.