You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thiago H. de Paula Figueiredo (JIRA)" <ji...@apache.org> on 2015/11/26 12:46:10 UTC

[jira] [Comment Edited] (TAP5-2225) Create client-side API to call a component's event handler methods

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

Thiago H. de Paula Figueiredo edited comment on TAP5-2225 at 11/26/15 11:45 AM:
--------------------------------------------------------------------------------

Hi!

What do you mean by module?

I would be actually easy to use. You'd just need to call something like T5.triggerEvent(domElement, eventName, queryParameters, successHandler, failureHandler). That function would take care of finding the correct event URL and making the AJAX call. There would be probably a similar function for updating zones.

The mixin would work server-side on a component, inspecting which events it handles and storing in data attributes its names and URLs which would later be used by the JavaScript functions. This way, it doesn't matter if it's a component or page, it would never create an URL for a non-existing event and avoids generating links for embedded components.

Creating event links for embedded components, IMHO, is something that should be avoided.

Also IMHO, limiting this to pages which aren't in a subdirectory (which I don't think the term "non-nested" applies, as it's not related to nesting at all) is a serious limitation, as it excludes its use in pages provided by component libraries.


was (Author: thiagohp):
Hi!

I would be actually easy to use. You'd just need to call something like T5.triggerEvent(domElement, eventName, queryParameters, successHandler, failureHandler). That function would take care of finding the correct event URL and making the AJAX call. There would be probably a similar function for updating zones.

The mixin would work server-side on a component, inspecting which events it handles and storing in data attributes its names and URLs which would later be used by the JavaScript functions. This way, it doesn't matter if it's a component or page, it would never create an URL for a non-existing event and avoids generating links for embedded components.

Creating event links for embedded components, IMHO, is something that should be avoided.

Also IMHO, limiting this to pages which aren't in a subdirectory (which I don't think the term "non-nested" applies, as it's not related to nesting at all) is a serious limitation, as it excludes its use in pages provided by component libraries.

> 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)