[
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]