[ 
https://issues.apache.org/jira/browse/TAP5-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15028641#comment-15028641
 ] 

Jochen Kemnade commented on TAP5-2225:
--------------------------------------

{quote}
What do you mean by module?
{quote}
JavaScript module, like in AMD.
{quote}
Creating event links for embedded components, IMHO, is something that should be 
avoided.
{quote}
Oh, misunderstanding, I meant components that are embedded in a page. But you 
already answered the question: by passing the domElement to the function.

About the signature:
Yes, I can see how you would find the component walking upward from 
{{domElement}}. Maybe that parameter could be optional to trigger the event on 
the page class? That's what I do currently.
It should be possible to pass request parameters as well as event context (like 
in {{page:event/context?param=foo}}).
I'm not sure about successHandler and failureHandler. Do you think they should 
be mandatory? I usually try to avoid callbacks and rather use 
AjaxResponseRenderer on the server side.

About the subdirectory pages: Sure, that should work, I just haven't tested it 
with my quick solution yet.

> Create client-side API to call a component's event handler methods
> ------------------------------------------------------------------
>
>                 Key: TAP5-2225
>                 URL: https://issues.apache.org/jira/browse/TAP5-2225
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Jochen Kemnade
>            Assignee: Thiago H. de Paula Figueiredo
>              Labels: ajax, event, handler, javascript
>
> It should be possible to create URLs for components' event handlers on the 
> client side.
> There could be a function that mirrors the behavior of 
> ComponentResources#createEventLink. It might be passed an event name or an 
> object with additional information such as a page name, a request context, or 
> additional request parameters.
> The function could either return the URL or a function that makes an XHR and 
> passes the response to a callback.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to