How to run a p: confirm through Bean?

0

My question is: How can I run a <p:confirm> through Bean?

I'll explain the problem better. When inserting a record I need to check if it already exists in the list in which I am entering the CPF. So far so good. I give a message with FacesMessages SEVERITY_ERROR and that's it!

But there is a business rule that should check if in the last 6 months the registration, in the CPF case, has already participated in another listing. In this case the rule says that one should ask the user if he confirms the new insertion.

Well, when I do the check in Bean, I do not know how to render a component on the screen so the user can confirm and continue processing, ie, inserting the record in this new tab!

Is it possible to do this?

    
asked by anonymous 15.10.2015 / 02:07

1 answer

1

Yes it is possible, it follows the code:

public void abrirConfirm() {
    RequestContext.getCurrentInstance().execute("PF('WidgetVarDoDialog').show();");
}

This code serves to open a <p:dialog> as well.

    
15.10.2015 / 14:38