I'm running the booking-faces sample that ships with WebFlow 2.3.1 - already uses PrimeFaces component library.
Now I'm trying to incorporate the PrimeFaces autoComplete component and I cannot get it to work. The component loads on the page but no suggestions appear when I type into it. The suggestions are supposed to come from my backing bean. I've put a breakpoint in my backing bean method and it never hits.
Can anyone help?
I opened the Chrome JavaScript console to see what requests/responses were flowing and found the following response returned whenever I typed into the autoComplete field:
Any ideas where things are broken? Thanks.Code:<partial-response><error><error-name>class com.sun.faces.context.FacesFileNotFoundException</error-name> <error-message><![CDATA[/WEB-INF/WEB-INF/test.xhtml Not Found in ExternalContext as a Resource]]></error-message></error></partial-response>
PrimeFaces version: 3.1.1
JSF version: Mojarra 2.1.7-jbossorg-2 (20120412-0335)
AppServer: Jboss AS 7.1.2
Spring framework version: 3.1.1
Spring WebFlow version: 2.3.1
I added an EL resolver to my faces-config.xml (I'm assuming this is necessary; why was it not in there already??):
Here's a snippet from test.xhtmlCode:<application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <message-bundle>JsfMessageResources</message-bundle> </application>
And here's my bean:Code:<h:form> <p:growl id="messages" showDetail="true" /> <p:autoComplete value="#{scheduleBean.text}" completeMethod="#{scheduleBean.complete}" /> </h:form>
Code:import org.springframework.stereotype.Component; import org.springframework.web.context.WebApplicationContext; @Component @Scope(WebApplicationContext.SCOPE_SESSION) public class ScheduleBean { private String text; public ScheduleBean() { } 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; } public String getText() { return text; } public void setText(String text) { this.text = text; } }


Reply With Quote
