This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes  autocomplete with h:inputText in jSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark " autocomplete with h:inputText in jSF" Watch " autocomplete with h:inputText in jSF" New topic

autocomplete with h:inputText in jSF

Zainab Haf

Joined: Sep 17, 2012
Posts: 11
How can i use autocomplete functionality with only JSF component h:inputText when i dont want to use rich ,primefaces or icefaces autocomplete tags?
with user entry i use valuechangeListener to get query entered and list set from db. the list is of SelectItem so that i can use f:selectItems as dropdown of autocomplete

Can anyone guide how can i get autocomplete functionality especialy showing dropdown using h:InputText or JSF component only??
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951

You cannot do that. JSF's core tag library reflects the HTML form primitives and they don't have an autocomplete control.

The only way to get autocomplete functionality using core JSF is to write a lot of explicit client-side JavaScript code that used AJAX to update the completion list. But that's false economy, since the extension taglibraries that provide native autocomplete such as RichFaces and PrimeFaces are already doing exactly that, more transparently and (even more importantly) THEIR code is already debugged and functional.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: autocomplete with h:inputText in jSF
Similar Threads
when using rich:autocomplete component ajax call from autocomplete.js file renders the data
line number for componentID?
jQuery find h:selectOneMenu component
how to use autocomplete in jsf
jQuery find h:selectOneMenu component