我有一個primefaces自動完成的問題。 JSF頁面是如下:Primefaces自動完成錯誤completeMethod
<h:inputText class="form-control" style="" for="villeRecherche"/>
<p:autoComplete id="villeRecherche"
value="#{rechercheRestoMb.selectedVille}"
completeMethod="#{rechercheRestoMb.completeVille}"
converter="convertisseurVille" var="c" itemLabel="#{c.ville}"
itemValue="#{c}" forceSelection="true" required="true" />
當JSF是叫我在這臺服務器的500錯誤:
javax.el.ELException: /corpsIndex.xhtml: The class 'fr.afcepf.al25.projetResto.managedBean.RechercheRestoMb' does not have the property 'completeVille'.
com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
我ManagedBean是RechercheRestoMb,它包含他的方法completeVille
如果我插入公共字符串completeVille與getter和setters我沒有錯誤,但自動完成不起作用。
任何人都有這個問題的想法?
您可以發佈您的類'rechercheRestoMb'和方法'completeVille' –
多問一個[MCVE](參見:http://www.stackoverflow.com/tags/jsf/info] – Kukeltje
在你的帖子你談了很多關於這個bean的信息,但是你不會發布它......爲什麼?只要看看PrimeFaces的展示,並將他們的例子與你的代碼進行比較。 – Kukeltje