Page 1 of 1

[SOLVED] possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 15:44
by edmund-wagner
Hello,
i have a working jsf2.0 setup with primefaces, but am getting some unexpected behaviour when using the slightly modified example code below

Code: Select all

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui" template="template.xhtml">
	<ui:define name="content">
		<h:form prependId="false">
			<p:panel id="panel" header="New Person">
				<h:messages />
				<h:outputText value="5 characters minimum" />
				<h:panelGrid columns="3">
					<h:outputLabel for="firstname" value="Firstname: *" />
					<h:inputText id="firstname" value="#{users.user.name}"
						label="Firstname">
						<f:validateLength minimum="5" />
						<p:ajax event="blur" update="panel" />
					</h:inputText>
					<h:outputText id="out3" value="#{users.user.name}" />
					<h:message for="firstname" />
				</h:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
the first onblur event is processed correctly. any further blur events seem to be ignored. when i replace the update="panel" with update="out3" everything works as expected (the outputText is updated on every blur event). Any ideas what is going wrong here?

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 16:02
by edmund-wagner
setup details:

libs:
  • backend-1.0.0-SNAPSHOT.jar
    libzfs-0.6-SNAPSHOT.jar
    commons-logging-1.1.1.jar
    commons-logging-api-1.1.jar
    jna-3.0.3-patch-1.jar
    jsf-api-2.0.jar
    jsf-impl-2.0.2.jar
    log4j-1.2.15.jar
    primefaces-2.0.0.RC.jar
faces-config

Code: Select all

<?xml version="1.0"?>
<faces-config 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-facesconfig_2_0.xsd"
   version="2.0">
	<validator>
		<description>Validates new password (equal)</description>
		<display-name>PasswordValidator</display-name>
		<validator-id>PasswordValidator</validator-id>
		<validator-class>utils.PasswordValidator</validator-class>
	</validator>
</faces-config>
web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>webgui</display-name>
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>
	<context-param>
		<param-name>com.sun.faces.allowTextChildren</param-name>
		<param-value>true</param-value>
	</context-param>
	<servlet>
		<servlet-name>Resource Servlet</servlet-name>
		<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>Resource Servlet</servlet-name>
		<url-pattern>/primefaces_resource/*</url-pattern>
	</servlet-mapping>
	<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>*.jsf</url-pattern>
	</servlet-mapping>
	<!-- Authentication -->
	<filter>
		<filter-name>CheckLoginFilter</filter-name>
		<filter-class>de.innosystec.webgui.auth.CheckLoginFilter</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>CheckLoginFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>
</web-app>

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 16:57
by Oleg
Interesting. Can you try please with

Code: Select all

<f:ajax event="blur" render="panel" />
?

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 17:30
by edmund-wagner
no action is executed, but i get the message:

"One or more resources have the target of 'head', but no 'head' component has been defined within the view."

cant find anything thats called or references "head" in html or xhtml

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 17:34
by cagatay.civici
Hi there, do you have h:head in your page?

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 18:12
by edmund-wagner
nope :)
ok now i can use the <f:ajax> to update the <h:panelGrid>, and it works as expected. but the <p:panel> disappears after update. I guess <f:ajax> is not able to handle <p:*> components

@cagatay
is it possible that some specific version of some library jsf / server libs (me using tomcat 6.0.20) is causing problems or is it the 1.2 -> 2.0 step.
i had some problems with multiple examples...
which libs do you use for 2.0 setup?

Re: possible bug in <p:ajax> / update ?

Posted: 18 Jan 2010, 18:40
by cagatay.civici
Hi Edmund,

For JSF 2.0 - PrimeFaces2 testing I use tomcat 6.0.18(as I remember), Mojarra 2.0.2.

I know many users have PrimeFaces2 and JSF2 with no problem, I'll try to try your page today to see if there's any problem and update this post.

Re: possible bug in <p:ajax> / update ?

Posted: 19 Jan 2010, 03:18
by cagatay.civici
Ok, I've tested this entirely with JSF 2.0.2 and PrimeFaces 2.x, it only works for the first time and fails for the subsequent updates. In JSF 1.2 and PrimeFaces 1.x it works perfect. Here's a related issue;

http://code.google.com/p/primefaces/iss ... ail?id=454

Fix will be ready by wednesday.

Thanks for reporting this issue

Welcome to forum Edmund,

Re: possible bug in <p:ajax> / update ?[SOLVED]

Posted: 13 Feb 2010, 18:39
by cagatay.civici
FYI this issue is fixed now.

Re: [SOLVED] possible bug in <p:ajax> / update ?

Posted: 25 Mar 2011, 22:21
by a4amar
Hi..

I am getting below error with primefaces-2.2.RC2 and glassfish301.
One or more resources have the target of 'head', but no 'head' component has been defined within the view.

Can you please let me know what is the resolution for this issue?

Thanks,
Amar.