p:ajax not fired

UI Components for JSF
Post Reply
can
Posts: 73
Joined: 09 Jan 2010, 03:56

09 Aug 2010, 00:07

Hi,
I m using pf 2.1 and GF 3.1 NetBeans 6.9
i want to use p:ajax like within showcase : http://primefaces.org:8080/prime-showca ... Events.jsf
But on my code it doesnt fired

This is my code;

Code: Select all

  <h:form  id="form">
            <h:inputText id="text" value="#{newJSFManagedBean.text}">
                <p:ajax event="keyup" update="OU_all"   />
            </h:inputText>
            <h:outputText id="OU_all" value="#{newJSFManagedBean.text}"/>
        </h:form>
and managedBean

Code: Select all

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author cancobanoglu
 */
@ManagedBean
@RequestScoped
public class NewJSFManagedBean {
    String text;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
    
    /** Creates a new instance of NewJSFManagedBean */
    public NewJSFManagedBean() {
    }

}

And web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>
		org.primefaces.resource.ResourceServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/primefaces_resource/*</url-pattern>
    </servlet-mapping>
</web-app>


callahan
Posts: 768
Joined: 27 May 2010, 22:52

09 Aug 2010, 01:04

Hi,

Does it work if your bean is ViewScoped?

can
Posts: 73
Joined: 09 Jan 2010, 03:56

09 Aug 2010, 01:41

No, neither with viewscoped nor sessionscoped version, it doesnt work.

callahan
Posts: 768
Joined: 27 May 2010, 22:52

09 Aug 2010, 07:52

Does it help if you add the following to web.xml:

Code: Select all

    <context-param>
        <param-name>com.sun.faces.allowTextChildren</param-name>
        <param-value>true</param-value>
    </context-param>
If this doesn't help, can you post the entire web page.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests