Announcement

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

    RPCManager SuccessHandler.

    Hello Folks,

    I have a situation where I need to close few HTML object on success response. and on Error need to display all those HTML object back with detail information from server.

    It is easy to handle Error, but how to handle success response ??

    in my php page I have bellow code.

    isc.RPCManager.addClassProperties({
    handleError : function (response, request) {
    if(response.status < 0)
    {
    ............................ display error.
    ............................................................. works fine.
    }
    }
    HandleSuccess: function ()
    {

    }

    Does smartclient have method like these ??
    How can i accomplish this? Is there any other way for this ?

    Thanking you.
    Last edited by ppratik; 23 Aug 2017, 01:13.

    #2
    Hi ppratik,

    there are callbacks available in RPCManager.sendRequest(), just like for DSRequest.

    Best regards
    Blama

    Comment


      #3
      Thank you for prompt reply,

      I already have used callback function, and that is for global use.

      I need something for page level, which I can over write at page level, not at global level,
      In this function I want to modify HTML object.

      Please check below code , this is in global file.

      isc.RPCRequest.create({
      contentType:
      httpHeaders: {
      'Accept': 'application/xml'
      },
      httpMethod: "POST",
      useSimpleHttp: true,
      requester: callback,
      data: data
      url: rest_console,


      callback: callback
      }

      Comment


        #4
        Blama
        ​​​​​​​Also , can you please explain me in detail with example ??

        Comment


          #5
          I did not use that before, so I can't really help. But what do you mean with "callback function is for global use"? You have a request, and after it returns, the callback is called. The callback can be different per request, can't it? So why is it global?

          Best regards
          Blama

          Comment


            #6
            By global mean, I have a class called SCobj, where I have common property for globally used SmartClient object like listGrid, treeGrid and also RPCManager, Here i have a function call consoleRequest, which further invoke RPCRequest , which handle every request at one place. Unless you have special requirement like I have for this page. In this situation, I add properties using isc.RPCManager.addClassProperties({ and overwrite them.

            So most feasible option for me to handle success at page level only.

            Comment

            Working...
            X