simpliest ajax example wouldn't work

UI Components for JSF
User avatar
mouadh
Posts: 85
Joined: 27 Apr 2010, 12:47
Location: Tunisia

09 Jul 2010, 14:45

first of all thanks for the help, i changed the library but :( it's not working either.

Code: Select all

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="/ajax/primefaces_resource/2.0.3-SNAPSHOT/skins/sam/skin.css" />
<script type="text/javascript" src="/ajax/primefaces_resource/2.0.3-SNAPSHOT/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="/ajax/primefaces_resource/2.0.3-SNAPSHOT/jquery/jquery.js"></script>
<script type="text/javascript" src="/ajax/primefaces_resource/2.0.3-SNAPSHOT/primefaces/core/core.js"></script>
        <title>Facelet Title</title></head><body>
<form id="j_idt7" name="j_idt7" method="post" action="/ajax/faces/index.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt7" value="j_idt7" />
<input id="firstname" type="text" name="firstname" value="gfhdfghgj" /><span id="out">gfhdfghgj</span><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="-1226634956965978362:-8137765449032479884" autocomplete="off" />
</form></body>

</html>
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8

User avatar
mouadh
Posts: 85
Joined: 27 Apr 2010, 12:47
Location: Tunisia

09 Jul 2010, 14:55

this is really gonna get me crazy, the online showcase does work, so i deployed the showcase into my server and it worked too, but when it came to my example it doesn't .
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

09 Jul 2010, 15:06

your ajax event is not registered,

the rendered html code should look like

Code: Select all

<input type="text" onkeyup="PrimeFaces.ajax.AjaxRequest('/prime-showcase/ui/ajaxifyKeyEvents.jsf',{formId:'j_idt39',global:true},{'j_idt39:j_idt43':'j_idt39:j_idt43','primefacesPartialUpdate':'j_idt39:out1'});" name="j_idt39:firstname" id="j_idt39:firstname">
how does your web.xml look like
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

User avatar
mouadh
Posts: 85
Joined: 27 Apr 2010, 12:47
Location: Tunisia

09 Jul 2010, 15:13

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>
</web-app>
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

09 Jul 2010, 15:20

add

Code: Select all

<context-param>
      <param-name>com.sun.faces.allowTextChildren</param-name>
      <param-value>true</param-value>
  </context-param>
to web.xml
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

User avatar
mouadh
Posts: 85
Joined: 27 Apr 2010, 12:47
Location: Tunisia

09 Jul 2010, 15:22

finally i got it worked i add

Code: Select all

<context-param>
		<param-name>com.sun.faces.allowTextChildren</param-name>
		<param-value>true</param-value>
	</context-param>
i have no idea what that mean :lol: :lol: but it worked , i have just copied it from web.xml of the showcase.
thanks for the help michiel
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8

User avatar
mouadh
Posts: 85
Joined: 27 Apr 2010, 12:47
Location: Tunisia

09 Jul 2010, 15:24

that's just what i have done. thx for the help
Ben Khalifa Mouadh
engineering student at National School of Computer Sciences - Tunisia
JSF 2.0, GlassFish v3, PF 2.0.1,Majorra 2.0.2, netBeans 6.8

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests