On Thu, 24 Jul 2014 20:12:43 -0300, ICE Ernesto Arteaga Zavala
<arterza...@gmail.com> wrote:
2014-07-24 17:33 GMT-05:00 Thiago H de Paula Figueiredo
<thiag...@gmail.com>
:
On Thu, 24 Jul 2014 19:31:35 -0300, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:
On Thu, 24 Jul 2014 19:04:09 -0300, ICE Ernesto Arteaga Zavala <
arterza...@gmail.com> wrote:
Why do you need that?
I'll integrate some backbone.js capabilieties, but zones are not the
better match to do it.
What exactly? Couldn't you just use query parameters instead of getting
the whole post information and parse it later?
Even if you're not going to use zones, you can still use Tapestry events
and pages and return JSONObject or JSONArray to feed your JavaScript.
How can I achieve that using the follow javascript:
First you need to create an URL to pass to your JavaScript code. For
events:
@Inject
private ComponentResources resources;
...
String eventUrl = resources.createEventLink("someEventName").toString();
Then pass it to your JavaScript code using JavaScriptSupport: script()
(easier), addInitializerCall() or require() (5.4+ only).
Then you can handle the event:
@OnEvent("someEventName")
Object handleYourEvent() {
...
return something; // in your case, it'll probably a JSONObject or
JSONArray.
}
Events = Backbone.Collection.extend({
model: Models.Event,
name: 'events',
url : '/events/index.all',
filter : JSON.Stringify(data),
});
I don't know Backbone, as probably most people in this mailing list, so
you're better off asking how to do x, not how to take some code in
Backbone and adapt it to Tapestry.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org