You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lance Java <la...@googlemail.com> on 2013/01/28 13:52:41 UTC

5.4-alpha-2 bug - Delegate component in event link body cancels ajax

I have found a bug in 5.4-alpha-2 which does NOT occur in 5.3.6 when using
the exact same code. The symptoms of the bug are:
1. I have a component parameter, "linkBody", which is a block
2. I delegate to the "linkBody" in the body of an ajax eventlink
3. When the "linkBody" parameter contains markup, the serverside event is
NOT XHR as expected
4. When the "linkBody" does not contain markup (a simple string), the
serverside event is XHR as expected
5. There are no javascript errors shown in the browser (firefox and chrome)
6. This happens for both prototype and jquery

The component (below) succeeds for the following tml:
=========================================
<t:myComponent>
   <p:linkBody>This is a plain text link body</p:linkBody>
</t:myComponent>

The component (below) throws a "NOT XHR" exception for the following tml:
=======================================================
<t:myComponent>
   <p:linkBody><div>This link body contains markup</div></p:linkBody>
</t:myComponent>

MyComponent.tml
=============
<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
xmlns:p="tapestry:parameter">
	<t:zone t:id="myZone" />
	<t:eventlink event="doIt" zone="myZone">
		<t:delegate to="linkBody" />
	</t:eventlink>
	<t:block t:id="ajaxBlock">
		Hello World
	</t:block>
</div>

MyComponent.java
==============
public class MyComponent {
	@Parameter(required=true)
	@Property
	private Block linkBody;
	
	@Inject
	private Block ajaxBlock;
	
	@Inject
	private Request request;
	
	Block onDoIt() {
		if (!request.isXHR()) {
			throw new RuntimeException("Request is not XHR");
		}
		return ajaxBlock;
	}
}



--
View this message in context: http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-bug-Delegate-component-in-event-link-body-cancels-ajax-tp5719612.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: 5.4-alpha-2 bug - Delegate component in event link body cancels ajax

Posted by Howard Lewis Ship <hl...@gmail.com>.
That's an odd thing. I'll look into it pretty soon.

On Mon, Jan 28, 2013 at 6:32 AM, Lance Java <la...@googlemail.com>wrote:

> I've simplified the bug report as it turns out that it has nothing to do
> with
> the delegate component. Any eventlink with markup in it's body prevents the
> event from being XHR/ajax.
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-bug-Delegate-component-in-event-link-body-cancels-ajax-tp5719612p5719619.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Re: 5.4-alpha-2 bug - Delegate component in event link body cancels ajax

Posted by Lance Java <la...@googlemail.com>.
I've simplified the bug report as it turns out that it has nothing to do with
the delegate component. Any eventlink with markup in it's body prevents the
event from being XHR/ajax.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-bug-Delegate-component-in-event-link-body-cancels-ajax-tp5719612p5719619.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: 5.4-alpha-2 bug - Delegate component in event link body cancels ajax

Posted by Lance Java <la...@googlemail.com>.
I've just filed a jira for this as I'm pretty sure it's a bug
https://issues.apache.org/jira/browse/TAP5-2060



--
View this message in context: http://tapestry.1045711.n5.nabble.com/5-4-alpha-2-bug-Delegate-component-in-event-link-body-cancels-ajax-tp5719612p5719617.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org