tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalle Korhonen (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2266) Incorrect EventListener documentation for intercepting Javascript functions
Date Tue, 16 Mar 2010 18:40:27 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846059#action_12846059
] 

Kalle Korhonen commented on TAPESTRY-2266:
------------------------------------------

JIRA is not a general discussion board. However, the code that calls triggerable.trigger()
is yours, ie. put it where ever you like. The example was meant showcase that you can bind
to listen to any client-side Javascript function invocation and get an server-side event triggered
simply by adding the annotation.

> Incorrect EventListener documentation for intercepting Javascript functions
> ---------------------------------------------------------------------------
>
>                 Key: TAPESTRY-2266
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2266
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 4.1.5
>         Environment: Any
>            Reporter: Kalle Korhonen
>            Assignee: Marcus Schulte
>            Priority: Minor
>             Fix For: 4.1.6
>
>
> The documentation at http://tapestry.apache.org/tapestry4.1/ajax/eventlistener.html has
an example for intercepting Javascript functions that uses both "targets" and "elements" arguments
for the annotation, but the documentation for the annotation itself says you can only use
either one or the other. Furthermore, it might make people better realize how much the annotation
simplifies client/server communication and how endless the possibilities really are if you
added something like this to the Javascript example:
> {code}
> The required html/Javascript snippet:
> <div id="triggerable"></div>
> <script type="text/javascript">
> var triggerable = document.getElementById('triggerable');
> triggerable.trigger = function(params) {
>   alert('calling server with answer ' + params.theAnswer);
> }
> </script>
> So, given a Javascript...
> @EventListener(events="trigger", elements="triggerable")
> public void onTriggered( BrowserEvent event ) {
> ...
> }
> {code}

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


Mime
View raw message