Hi,

I have been using extjs library Ajax object as:
        var o = {
                form : "cred_form",
                success: this._onReqDone,
                scope: this,
                url: config.loginUrl,
                disableCaching: true,
                method: 'POST'
        };

        Ext.Ajax.request(o);

when I moved to GWT-Ext I have the corresponding fragment as:

                Ajax a = Ajax.getInstance();
                RequestParam rp = new RequestParam();
                rp.setForm("cred_form");
                rp.setMethod(Connection.POST);

                a.addListener(new ConnectionListener(){
                        public boolean doBeforeRequest(Connection conn) {
                                return true;
                        }

                        public void onRequestComplete(Connection conn,
                                        String responseText){

                                Window.alert("On Complete");

                        }

                        public void onRequestException(Connection conn,
                                        int httpStatus, String responseText) {

                                Window.alert("Problem, please try again");
                        }
                });

                a.request(rp);

The problem is that there is no API to remove the connection listener
from Ajax object (which is a singleton). So what happens is that my
handlers (onReq...) keep on getting invoked for all the different Ajax
requests. I just want one listener/handler for one request.

While browsing through the GWT-Ext code I noticed that documentation
of Connection class talks about CallBack very much like the pure
javascript (extjs) one

"The class encapsulates a connection to the page's originating domain,
allowing requests to be made either to a configured URL, or to a URL
specified at request time.
 * Requests made by this class are asynchronous, and will return
immediately. No data from the server will be available to the
statement immediately following the request call. To process returned
data, use a callback in the request options object, or an event
listener."

But I really can't understand how to use it. Looked at Requestparam
class but it does not have any method to specify callback etc ?.

Please help

---

I also looked at RequestBuilder and FormPanel provided by GWT.

- RequestBuilder does not help me as I just need to submit a form
asynchronously.
- FormPanel does not fire events if it wraps an existing form which is
the case for me.

Would really appreciate if some one can help solving this problem of
mine !

Regards & thanks
Kapil



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to