PDA

View Full Version : Ext.ajax request



emilioF
1 Jul 2010, 2:30 AM
hi i have read that ext.ajax is a singleton. how i can make 2 different requests for example a get on servlet1 and a post on servlet2?

fay
1 Jul 2010, 2:39 AM
The important part in the docs is:


This class is a singleton and cannot be created directly.

You can make multiple requests, you just don't create an instance of Ext.Ajax - there is one already - and if there is anything particular (i.e., non-common properties) about the request, you just change them in the request (http://www.sencha.com/deploy/dev/docs/?class=Ext.Ajax) function's options parameter.

emilioF
1 Jul 2010, 4:13 AM
thanks for the answer, but i don't understand all. my script is this http://pastebin.com/QxyB8kKW at the beginning make a get request and servlet return a page with some links and when i click on a link i want make other request to get me the documet in the link. how i can do it?

mohan_b
1 Jul 2010, 4:37 AM
There are many ways to do it..

A couple of methods..

1) You add onclick events to the links on the fly when you get the response.

2) Add inline javascript to links calling a specific function which makes the request

emilioF
1 Jul 2010, 4:43 AM
thanks i will try