I just started using PrimeFaces and cannot figure what is wrong with my code. It is exactly the same as the show case sample with the exception of the bean names. I looked at this site for answers without success.
PrimeFaces:
<p:calendar value="#{securityForecastReturnBean.date}"
mode="inline" onSelectUpdate="inputsGrowl"
selectListener="#{securityForecastReturnBean.handleDateSelect}"
required="true" />
Java Bean:
@Component
@Scope("request")
@ManagedBean
public class SecurityForecastReturnBean {
public void handleDateSelect(DateSelectEvent event) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.addMessage(null,
new FacesMessage(FacesMessage.SEVERITY_INFO, "Date Selected",
format.format(event.getDate())));
}
}
It should be really straightforward yet it is saying that my bean does not have this property??
Here is the exact error message:
javax.servlet.ServletException: /security_page.xhtml: The class 'com.ls.forecast.webui.beans.SecurityForecastReturnBean' does not have the property 'handleDateSelect'.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:363)
com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
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:313)
I am using PrimeFaces 2.2.1.
Any help would be greatly appreciated!
I figured out my issue. It had to do with using the wrong namespace. I had to use http://primefaces.org/ui instead of the old one.