Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript jQuery
Hi
can you please help me to remove this error.? i am getting error
Uncaught TypeError: Object #<Object> has no method 'webservicesCall'
 
i am using this example:
Auto-suggest Control[^]
 
i call like this
 
new autosuggest("getStationDesc", stationList, null, function(index, control) {
               
 
                var stationCode = control.keywords[index].substring(0, 3);
                console.log(stationCode);
                this.webservicesCall(stationCode);// i call web service here and here i getting error Uncaught TypeError: Object #<Object> has no method 'webservicesCall' 
                });
 

here is web service method********
 

webservicesCall : function(stationCode) {
            alert("hi");
            var _this = this;
            var pl = new SOAPClientParameters();
            var parameter1 = stationCode;
            pl.add("parameter1", parameter1);
            SOAPClient.invoke(App.settings.server, "getDepartureStationDashboard", pl, true, _this.DepartureStationDashboard_callBack);
        },
Posted 6-Oct-12 18:19pm
Comments
Sandeep Mewara at 7-Oct-12 1:41am
   
Is the 'webservicesCall' present in the same JavaDcript/HTML file?
ravi1989h at 7-Oct-12 1:54am
   
yes ..actually i am using backbone.so all function is in controller file.
ravi1989h at 7-Oct-12 1:55am
   
;(function() {
 
fg.pages.departure = fg.PageController.extend({
regions : {
mainRegion : '.departure',
},
template : {
regionTemplate : 'departure/departure'
},
events : {
'click .back_h' : 'goBack',
'click .go_home_h' : 'goToDashBoard',
//'blur #getStationDesc' : 'test',
'click .cleardata_h': 'clearStationField',
'click .cleardataAll_h': 'clearFilterField',
'click .menuoption_h':'getMenuoptions',
 
},
scrollAreas : {
expertAnswerImg : {
id : "departure_scroll", // id of the scroller you want to have (temp)
element : ".departure", // element that needs to be wrapped in the iScroll
footer : true,
footer_element : ".generic_css_footer", // does footer need to be handled
scrollable : true,
adjust : -10 // does div needs to have iScroll (Default: true)
}
},
init : function() {
_.bindAll(this, "webservicesCall", "DepartureStationDashboard_callBack");
/*var LS_last_searched_station = window.localStorage.getItem('LS_last_searched_station');
if (LS_last_searched_station != null) {
this.webservicesCall(LS_last_searched_station);
}*/
this.webservicesCall("pdw");
},
DepartureStationDashboard_callBack : function(r) {
console.log(r);
App.collections.departure = new fg.collections.departure;
App.views.departure = new fg.views.departure;
this.region('mainRegion').show(App.views.departure);
if (r.length == 0) {
App.collections.departure.reset([{
empty_feed : true
}]);
} else {
App.collections.departure.reset(r);
}
 
},
goBack : function() {
 
history.back();
},
goToDashBoard : function() {
history.back();
},
linkElements : function() {

var stationList = new Array;
var r = JSON.parse(window.localStorage.getItem("stations")) || [];
for (var i = 0; i < r.length - 1; i++) {
stationList[i] = r[i].stationCode + " - " + r[i].stationName;
}

new autosuggest("getStationDesc", stationList, null, function(index, control) {
//alert("Selected key: \"" + control.keywords[index] + "\" with value: \"" +index+ "\"");

var stationCode = control.keywords[index].substring(0, 3);
console.log(stationCode);
this.webservicesCall(stationCode);
});

/*var obj = actb(document.getElementById('getStationDesc'), stationList);
var obj = actb(document.getElementById('getfilter'), stationList);
 
obj.actb_timeOut = -1;
obj.actb_lim = 10;
obj.actb_firstText = true;
obj.actb_mouse = true;
obj.actb_delimiter = new Array(' ', ',');
obj.actb_startcheck = 1;
 
obj.actb_bgColor = '#dbe3ec';
obj.actb_textColor = '#00256a';
obj.actb_hColor = '#dbe3ec';
obj.actb_fFamily = 'arial';
obj.actb_fSize = '16px';
obj.actb_hStyle = 'text-decoration:underline;font-weight="bold;";text-align="left"';*/
 
},
/*test : function(e) {
e.preventDefault();
console.log("oi");
if ($(e.target) == '') {
 
} else {

var stationCode = $(e.target).val().substring(0, 3);

window.localStorage.getItem('LS_last_searched_station', stationCode)
this.webservicesCall(stationCode)
}
 
},*/
webservicesCall : function(stationCode) {

var _this = this;
var pl = new SOAPClientParameters();
var parameter1 = stationCode;
pl.add("parameter1", parameter1);
SOAPClient.invoke(App.settings.server, "getDepartureStationDashboard", pl, true, _this.DepartureStationDashboard_callBack);
},
clearStationField :function(){
this.$el.find('.frm_txtfield_from_h').val('');
},
clearFilterField :function(){
this.$el.find('.frm_txtfield_all_h').val('');
},
getMenuoptions: function(){

$("#menu").slideToggle("slow");
},
});
})();
Mohibur Rashid at 7-Oct-12 9:00am
   
whome arexyou answering
ravi1989h at 7-Oct-12 10:10am
   
i got solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 245
1 Sergey Alexandrovich Kryukov 217
2 OriginalGriff 200
3 Peter Leow 160
4 Afzaal Ahmad Zeeshan 85
0 OriginalGriff 7,380
1 DamithSL 5,359
2 Sergey Alexandrovich Kryukov 4,944
3 Maciej Los 4,906
4 Kornfeld Eliyahu Peter 4,514


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 6 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100