Display dialog with first faces when clicking on an emptyMessage of a p:autocomplete

Asked

Viewed 96 times

1

Well I am using Primefaces I have a field p:autocomplete to search Employees, I would like when typed a name and no results found it displayed the message "No employees found, click here to register" (display the message already done using the emptyMessage attribute of the autocomplete), and when clicked on here a dialog was displayed. I tried using AJAX but without success I believe I will have to use Javascript or jQuery, if you can help me thank you already!! Following the code of the autocomplete:

<p:autoComplete value="#{bean.funcionario}"
    completeMethod="#{bean.completarFuncionario}" var="funcionario"
    itemLabel="#{funcionario.nome}" itemValue="#{funcionario}"
    emptyMessage="Nenhum funcionário encontrado click aqui para cadastrar!" />   
  • The problem is that you can’t put links in the autocomplete emptyMessage. What I suggest is that in this situation you render a link outside, below the autocomplete, for example. It would work like this for you?

  • I believe so, but how would I know if the search in Autocomplete returned results or not, so I can render the link or not?

No answers

Browser other questions tagged

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