AnsweredAssumed Answered

Calling a function after using esri.request isn't working..

Question asked by Rahmath_U on Jul 20, 2015
Latest reply on Sep 20, 2018 by rscheitlin

Hello,

 

I have created a function in a customized widget named as "Requestdata" where it requests the data from the soe url and returns a response as shown below.

 

Requestdata :function(){

  var LL = "Soe url";

 

  var list = esriRequest({

              url: LL,

              content: { f: "json" },

              handleAs: "json",

             callbackParamName: "callback",

             timeOut:0,

             },{useProxy:true});

   list.then(

function(response) {        

var features = response;

this.Newfunction();------------------------------>(Having an issue in calling this function)

  

                 },

  function(error) {

  console.log("Error: ");

                    }

  );

When I call a function named as "this.Newfunction" in the response function, it does not work. Also, the widget executes all other functions in the widget and then makes the request at last even though i request it it at the starting point.

 

Any suggestions on this??

 

 

Thanks &Regards,

Rahmath Unissa

Outcomes