Error in passing parameter Confirm Dialog Primefaces

Asked

Viewed 10 times

0

I am using version 7 of the first faces with JSF 2.2

By clicking the delete button the parameter is not passed correctly.

<p:column headerText="Ação">

    <p:commandButton icon="fa fa-fw fa-edit" />

    <p:commandButton icon="fa fa-fw fa-trash">
        <p:confirm message="#{cartorio.nome}" header="Tem certeza que deseja excluir esse Cartório?"/>
    </p:commandButton>

    <p:confirmDialog  global="true" showEffect="fade" hideEffect="fade">
        <p:commandButton process="@form" update="formCartorio:message" actionListener="#{managerCartorio.confirmarCartorio(cartorio)}" value="Sim" icon="fa fa-fw fa-check" styleClass="ui-confirmdialog-yes" />
        <p:commandButton value="Não" styleClass="ui-confirmdialog-no" icon="fa fa-fw fa-remove" />
    </p:confirmDialog>

</p:column>

The parameter cartorio.name is passed correctly to confirm, but when I run the delete option it weighs the last of my lsita.

    public void confirmarCartorio(Cartorio cart) {
        this.cartorio = cart;
        MensagemGrow.mostraMsg("Cartório " + cart.getNome() + " excluído com sucesso!");
        System.out.println("Cartório escolhido: " + cart.getNome());
    }

Dialog window receives the right registry office. But the function is executed in another registry office.

  • You said you have a list and it takes the last one from the list. Is it not a problem with the equals of this entity?

No answers

Browser other questions tagged

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