Note that there are some explanatory texts on larger screens.

plurals
  1. POPrimefaces basic autocomplete not working
    primarykey
    data
    text
    <p>I am trying <a href="http://www.primefaces.org/showcase-labs/ui/autoCompleteBasic.jsf" rel="nofollow">autocomplete demo</a> .I am not getting any error but the httprequest/response shows that it is communicating with the server but not to the bean. I am using latest version of primefaces 3.4.</p> <p>Any help is appreciated.</p> <p>Bean :</p> <pre><code>import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; import com.zreflect.emyed.managedbean.BaseMB; @ManagedBean @ViewScoped public class CircleSearchBean extends BaseMB implements Serializable { private static final long serialVersionUID = 1L; private String selected; List&lt;String&gt; results = new ArrayList&lt;String&gt;(); public List&lt;String&gt; complete(String query) { List&lt;String&gt; results = new ArrayList&lt;String&gt;(); for (int i = 0; i &lt; 10; i++) { results.add(query + i); } return results; } /** * @return the selected */ public String getSelected() { return selected; } /** * @param selected * the selected to set */ public void setSelected(String selected) { this.selected = selected; } } </code></pre> <p>XHTML</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core"&gt; &lt;h:head&gt; &lt;title&gt;&lt;h:outputText value="test" /&gt;&lt;/title&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;h:form&gt; &lt;p:autoComplete value="#{circleSearchBean.selected}" completeMethod="#{circleSearchBean.complete}"/&gt; &lt;/h:form&gt; &lt;/h:body&gt; &lt;/html&gt; </code></pre> <p>Here's debug information from Chrome developer tools.</p> <p>Request:</p> <pre class="lang-none prettyprint-override"><code>Request URL:http://localhost:8080/PrimefacesTest/faces/index.xhtml Request Method:POST Status Code:200 OK </code></pre> <p>Request headers:</p> <pre class="lang-none prettyprint-override"><code>Accept:application/xml, text/xml, */*; q=0.01 Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:157 Content-Type:application/x-www-form-urlencoded; charset=UTF-8 Cookie:JSESSIONID=60Wd6aXSj6rDbPOgvMCoFJFF.undefined Faces-Request:partial/ajax Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/PrimefacesTest/faces/index.xhtml User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1 X-Requested-With:XMLHttpRequest </code></pre> <p>Form data:</p> <pre class="lang-none prettyprint-override"><code>javax.faces.partial.ajax:true javax.faces.source:j_idt8 javax.faces.partial.execute:j_idt8 javax.faces.partial.render:j_idt8 j_idt8:j_idt8 j_idt8_query:hello </code></pre> <p>Response headers:</p> <pre class="lang-none prettyprint-override"><code>Cache-Control:no-cache Content-Length:346 Content-Type:text/xml;charset=UTF-8 Date:Sun, 02 Sep 2012 21:11:42 GMT Server:Apache-Coyote/1.1 X-Powered-By:JSF/2.0 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload