Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

response from HttpClient doesnt fill tablerowView

$
0
0

Hi, i am trying to connect to a URL using httpclient in my app , and it printed the response to the console but to print it on TABLEROW VIEW is printed empty , view my code below :

var conn = Titanium.Network.createHTTPClient(); var url = 'http://127.0.0.1:8081/example/table.ashx?method=mobile='+ temp_num; Ti.API.info(url); conn.onload= function(e){ response = this.responseText;

                         var row  =  Ti.UI.createTableViewRow({
                       title:people[i].fullName,
                       desc:response,//temp_num,
                       leftImage:'topup1.png'
                      });                   
                        data.push(row);   
                        alert("successful");          
                  };//end of function onload ;

                  conn.DONE = function(e){
                     alert("REQUEST is DONE");
                  };
               conn.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
               conn.setRequestHeader("User-Agent",Titanium.userAgent);
               conn.open("POST",url);
               conn.send();

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>