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

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GYEs=mw48MAL_su4JGLqh1eBX9h_pCwc1Ae=9HSnoZAgg@mail.gmail.com>
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
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.