Andy,

I already pointed out this problem, that doesnt seem to be browser related, but merely due to T5 conception. Basically Howard answered that on a div refresh, the id of the refreshed elements nested in that div are changed by T5 : a timestamp based code is added, making them unique among the client DOM. If this div contains itself another div, pointed by a link, then that link is lost. It explains the page refresh, since your action link (or event link) points to nothing.

Howard didnt make any clear statement about that, but it seems to me that nesting Zones is not legal in T5, or at least needs some patching in order to work properly.

José

Andy Blower a écrit :
Rather than explain (probably badly) exactly what the problem is, I'll
provide a small example page called BasicAJAX. This page demonstrates that
if an actionlink that causes a zone refresh via AJAX is part of the
refreshed zone itself, it only works on alternate clicks in IE. Each time
it's rendered as part of the zone update it causes a full page refresh when
clicked, which means it can do a zone update the following click. It works
fine in Firefox though.

If I return a block instead of a zone the second click in the link inside
causes the ComponentEventException shown below, instead of the full page
refresh.

org.apache.tapestry.runtime.ComponentEventException - A component event
handler method returned the value
[EMAIL PROTECTED] Return type
org.apache.tapestry.internal.structure.BlockImpl can not be handled.
Configured return types are java.lang.Class, java.lang.String, java.net.URL,
org.apache.tapestry.Link, org.apache.tapestry.StreamResponse,
org.apache.tapestry.runtime.Component.


It looks like a bug to me, should it be entered into a bug DB somewhere? I
hope that this is a known problem that has already been fixed or is in the
process of being fixed because it's a pretty big dealbreaker for T5 AJAX
support as IE is still the dominant browser.

(using T5.0.11, IE6.0.2900, FF2.0.0.6, Tomcat5.5.9)

--------- BasicAJAX.java ---------
package com.proquest.Tap5ProtoIMPA.pages;

import org.apache.tapestry.annotations.Component;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.annotations.Property;
import org.apache.tapestry.corelib.components.Zone;


public class BasicAJAX
{
	@Property
	@Persist
	private int count = 0;

	@Component
	private Zone aZone;

	Object onActionFromOutsideZone() {
		count++;
		return aZone;
	}
	
	Object onActionFromInsideZone() {
		count++;
		return aZone;
	}
}

--------- BasicAJAX.tml ---------
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<body style="font-family: Arial, Helvetica, sans-serif;  font-size:
smaller;">
	
	<h1>Basic AJAX Tester (${count} - only updates on full page refresh)</h1>
	
	 # Refresh - this is an AJAX-enabled ActionLink <br/><br/>
	
	<div style="margin-left: 50px">
		<div t:type="zone" t:id="aZone">
			<p>I am a AJAX updated ZONE! count=${count}</p>
			 # Refresh - this is an AJAX-enabled ActionLink <br/><br/>
		</div>
	</div>

</body>
</html>
  
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to