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

Reply via email to