why the AutoComplete can't work

UI Components for JSF
Post Reply
PanYan
Posts: 38
Joined: 27 May 2009, 03:16

17 Jun 2009, 08:34

the code in the jsp and the bean is same to the demo

but why the list can't show???

code in the jsp:
<f:view>
<p:resources />


<p:autoComplete value="#{treeBean.text}" completeMethod="#{treeBean.complete}">
</p:autoComplete>
</f:view>

code in the bean :
public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}

public List<String> complete(String query) {
List<String> results = new ArrayList<String>();
for (int i = 0; i < 10; i++)
results.add(query + i);
return results;
}

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

17 Jun 2009, 10:24

Weird, it should work with your configuration. The difference is online demo uses facelets, I'll look into this, our jsp based example application has an autocomplete working.

Can you see the ajax request-responses with firebug and compare them with the online demo?

PanYan
Posts: 38
Joined: 27 May 2009, 03:16

19 Jun 2009, 04:36

I find that <p:autoComplete> need to be put in a <h:form>,hehe. :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests