You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Daniel Watson (JIRA)" <de...@tapestry.apache.org> on 2008/08/14 22:07:44 UTC

[jira] Created: (TAPESTRY-2587) Tapestry EventListener annotations produce incorrect bind URLs in portal context

Tapestry EventListener annotations produce incorrect bind URLs in portal context
--------------------------------------------------------------------------------

                 Key: TAPESTRY-2587
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2587
             Project: Tapestry
          Issue Type: Bug
          Components: Portlet
    Affects Versions: 4.1.5, 4.1.3, 4.1.2, 4.1.1, 4.1
         Environment: Windows XP
            Reporter: Daniel Watson


The javascript rendered by the Body component for a standard element event listener:

<script type="text/javascript"><!--
	tapestry.addOnLoad(function(e) {
		tapestry.cleanConnect("testElement", "onclick", "event2061605841");
		tapestry.event2061605841=function(e){
			var content={beventname:"onclick"};
			tapestry.event.buildEventProperties(e, content, arguments);
			if (!content["beventtarget.id"]) content["beventtarget.id"]="testElement";
			tapestry.bind("/email-portlet/app?page=AliasList&service=directevent", content);
		};
		tapestry.connect("testElement", "onclick", "event2061605841");
	});
// --></script>

...Is rendered incorrectly in a *portal* context.  More specifically the URL passed to the tapestry.bind(...) call is not the URL of the web-app, but the current URL of the portal.

For example in a java portal container the above code contains will use a URL like...

http://localhost:8080/portletdriver/dt?[...removed portal crap...]&page=AliasList&service=directevent

...which obviously never reaches the tapestry event listener.



Im guessing that component,rather than element, EventListeners experience the same problem.

So far I know that manually (as in - hard coding) the javascript with the correct URL into the template makes the event listener work.  I realize this is in no way suitable, and it was only for testing purposes.  If someone could shed a little light on the javascript rendering process for EventListener annotations I think can write a more permanent fix that renders the correct URL in a portal context.

Specifically... where in the tapestry source does this script get generated?




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-2587) Tapestry EventListener annotations produce incorrect bind URLs in portal context

Posted by "Daniel Watson (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628454#action_12628454 ] 

Daniel Watson commented on TAPESTRY-2587:
-----------------------------------------

The fix for this is to replace the line:

<set-object property="linkFactory" value="infrastructure:linkFactory" />

in tapestry.event.xml of tapestry-framework, with:

<set-object property="linkFactory" value="service:tapestry.url.LinkFactory" />

Im not sure of the implications of this fix, but it hasn't caused any issues since ive patched my local copy with it.  Id prefer if someone else would review and confirm that it is indeed correct.

> Tapestry EventListener annotations produce incorrect bind URLs in portal context
> --------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2587
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2587
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Portlet
>    Affects Versions: 4.1, 4.1.1, 4.1.2, 4.1.3, 4.1.5
>         Environment: Windows XP
>            Reporter: Daniel Watson
>
> The javascript rendered by the Body component for a standard element event listener:
> <script type="text/javascript"><!--
> 	tapestry.addOnLoad(function(e) {
> 		tapestry.cleanConnect("testElement", "onclick", "event2061605841");
> 		tapestry.event2061605841=function(e){
> 			var content={beventname:"onclick"};
> 			tapestry.event.buildEventProperties(e, content, arguments);
> 			if (!content["beventtarget.id"]) content["beventtarget.id"]="testElement";
> 			tapestry.bind("/email-portlet/app?page=AliasList&service=directevent", content);
> 		};
> 		tapestry.connect("testElement", "onclick", "event2061605841");
> 	});
> // --></script>
> ...Is rendered incorrectly in a *portal* context.  More specifically the URL passed to the tapestry.bind(...) call is not the URL of the web-app, but the current URL of the portal.
> For example in a java portal container the above code contains will use a URL like...
> http://localhost:8080/portletdriver/dt?[...removed portal crap...]&page=AliasList&service=directevent
> ...which obviously never reaches the tapestry event listener.
> Im guessing that component,rather than element, EventListeners experience the same problem.
> So far I know that manually (as in - hard coding) the javascript with the correct URL into the template makes the event listener work.  I realize this is in no way suitable, and it was only for testing purposes.  If someone could shed a little light on the javascript rendering process for EventListener annotations I think can write a more permanent fix that renders the correct URL in a portal context.
> Specifically... where in the tapestry source does this script get generated?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-2587) Tapestry EventListener annotations produce incorrect bind URLs in portal context

Posted by "Daniel Watson (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622680#action_12622680 ] 

Daniel Watson commented on TAPESTRY-2587:
-----------------------------------------

This has also revealed what seems to be an inconsistency (still in portal context)

When rendering templates of pages with EventListener annotations, the listeners using the "targets=" property render their script if the @ScriptIncludes component is present in the template.  However EventListener annotations that use the "elements=" property only have their script rendering if the @Body component is present in the template.  Which can be an issue for portlets since its advised that they *not* use the Shell or Body tags.

I dont know enough about the src to figure out where the decision is made to render these scripts.

> Tapestry EventListener annotations produce incorrect bind URLs in portal context
> --------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2587
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2587
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Portlet
>    Affects Versions: 4.1, 4.1.1, 4.1.2, 4.1.3, 4.1.5
>         Environment: Windows XP
>            Reporter: Daniel Watson
>
> The javascript rendered by the Body component for a standard element event listener:
> <script type="text/javascript"><!--
> 	tapestry.addOnLoad(function(e) {
> 		tapestry.cleanConnect("testElement", "onclick", "event2061605841");
> 		tapestry.event2061605841=function(e){
> 			var content={beventname:"onclick"};
> 			tapestry.event.buildEventProperties(e, content, arguments);
> 			if (!content["beventtarget.id"]) content["beventtarget.id"]="testElement";
> 			tapestry.bind("/email-portlet/app?page=AliasList&service=directevent", content);
> 		};
> 		tapestry.connect("testElement", "onclick", "event2061605841");
> 	});
> // --></script>
> ...Is rendered incorrectly in a *portal* context.  More specifically the URL passed to the tapestry.bind(...) call is not the URL of the web-app, but the current URL of the portal.
> For example in a java portal container the above code contains will use a URL like...
> http://localhost:8080/portletdriver/dt?[...removed portal crap...]&page=AliasList&service=directevent
> ...which obviously never reaches the tapestry event listener.
> Im guessing that component,rather than element, EventListeners experience the same problem.
> So far I know that manually (as in - hard coding) the javascript with the correct URL into the template makes the event listener work.  I realize this is in no way suitable, and it was only for testing purposes.  If someone could shed a little light on the javascript rendering process for EventListener annotations I think can write a more permanent fix that renders the correct URL in a portal context.
> Specifically... where in the tapestry source does this script get generated?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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