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?
– Giuliana Bezerra
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?
– Alysson Oliveira