Page 2 of 2

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 14:45
by mouadh
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>

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 14:55
by mouadh
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 .

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 15:06
by michiel
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

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 15:13
by mouadh
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>

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 15:20
by michiel
add

Code: Select all

<context-param>
      <param-name>com.sun.faces.allowTextChildren</param-name>
      <param-value>true</param-value>
  </context-param>
to web.xml

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 15:22
by mouadh
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

Re: simpliest ajax example wouldn't work

Posted: 09 Jul 2010, 15:24
by mouadh
that's just what i have done. thx for the help