Re: [Announcement] New feature for Tapestry 5.4.2 and 5.5: easily call event handler methods from JavaScript

abangkis <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAGqeSzV4OTd_g8DpbG7DSuU_Dgg1V6FhF+pohapBUv39m+W4SQ@mail.gmail.com>
Thank you very much. I got it working. Now my code is going to be a whole
lot cleaner.

Good job Thiago.

On Thu, Apr 27, 2017 at 7:10 PM, Thiago H. de Paula Figueiredo <
[email protected]> wrote:

> On Thu, Apr 27, 2017 at 6:43 AM, abangkis <[email protected]> wrote:
>
> > Hi. Thanks for the awesome improvement. I want to adopt it immediately.
>
>
> Hi! Nice! :)
>
>
> > But I've stumbled to one problem. How do I pass a parameter to the event?
> >
>
> You don't pass it to the event, but to the t5/core/ajax() function. Check
> the data property of the options parameter in
> https://tapestry.apache.org/current/coffeescript/ajax.html. Basically, you
> pass an object with the key/value pairs you want passed as parameters:
>
> ajax('answer', {
>     element: $('#result'),
> /* Here it goes */
> data: {
> queryParameter1: valueParameter1,
> queryParameter2: valueParameter2
> }
> /* Here it ends */
>     success: function(response) {
>         $('#result').text(response.json.origin);
>     }
> });
>
>
> --
> Thiago
>



-- 
http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.