0
Good morning guys, I need to open a dialog for report, and in p:inputtext I need to validate if there is such a client , if there is no client list open by another dialog and select which client,however I need to download the report when I open this dialog no and I click on the button to generate the report does not happen the download because Ajax turns true and closes the dialog of the report, when I open again the data continue and I can download. would like to know how to make Ajax false again not to close the screen and download I’m using primefaces and apache poi.
follows the code
<p:inputText id="cliente" value="#{dialogpadrao.cliente}" autocomplete="off" size="10">
<p:ajax event="blur" listener="#{dialogpadrao.abredialogcliente}" update="cliente descrição" />
</p:inputText>
<p:outputLabel id="descrição" value="#{dialogpadrao.desccli}" />
</h:panelGrid>
public void abredialogcliente() {
Cadcli clientep = new Cadcli();
if (cliente != null && !cliente.isEmpty()) {
clientep = new Cadcli();
EntityManager manager = this.getManager();
CadcliRepository repository = new CadcliRepository(manager);
clientep = repository.procuracodigo(cliente);
if (clientep.getId() == null) {
session.setAttribute("pagina", "dialogpadrao");
org.primefaces.context.DefaultRequestContext.getCurrentInstance().execute("PF('dlgcliente').show()");
} else {
cliente = clientep.getCodcli();
this.setDesccli(clientep.getDesccli());
}
}
}
}
Post the full page. Did you debug to see if you’re getting to your method? Checked the id of
dlgcliente
to confirm that it is correct on the page?– nullptr