No announcement yet.
  • Filter
  • Time
Clear All
new posts

  • How to make an Ajax Request in SmartGwt?

    I need to make an Ajax Request as below from my client side, how can I do that?

    var url = "/common/monitorTask.jsp";
      var params = "action=addTask&taskId="+taskId;

      new Ajax.Request(url, {
            asynchronous: true,
            method: "get",
            parameters: params

  • #2
    It depends what this request is for. DataSources can be configured to send a simple request like that, with the dsRequest.criteria included in the URL (dataProtocol:"getParams"). They can then parse XML or JSON responses, or you can add logic to parse something else.

    If this request is totally unrelated to DataSource operations, you can either use RPCManager.send() with an RPCRequest where useSimpleHttp:true has been set, or you can use core GWT APIs (as in, APIs provided by GWT itself, separate from SmartGWT APIs) that provide similar functionality.