Hello,
hopefully I can explain my problem.
I started to create extended control with ajax control toolkit. Idea is, that I have textfield which works so
that it suggest values every time when user hits key. Like that --> http://www.google.com/webhp?complete=1&hl=en
Now in SearchTextBoxBehavior.js file I have two propertys, which one hold id for listbox which shows suggestions.
(I think in that google example, the control is span or div element.)
Ok, I have succesfully created event, which is occurred when user hits key in textfield. Webservice call is made in bold code line-->
1 _onkeyup : function() {
2
3 var targetButton = $get(this._TargetButtonID);
4 var targetListBox = $get(this._TargetListBoxID);
5
6 if(targetButton && targetListBox) {
7 targetButton.disabled = true;
8
9 // unescape() convert´s a string to URL-encoded form
10 var searchValue = unescape(this.get_element().value);
11
12 if(searchValue != "") {
13 // Set suggestion visible
14 targetListBox.style.visibility = "visible";
15
16 MyCompany.WebServices.MySearch.GetDataTableFromWebservice(searchValue, this._onSucceeded);
17 }
18 else {
19 // Set suggestion hidden when there is no search value inserted
20 targetListBox.style.visibility = "hidden";
21 }
22 }
23
24 },
Web service call is succesfull, and returns into function:
1 _onSucceeded : function(Result) {
2
3 var targetListBox = $get(this._TargetListBoxID);
4
5 var table = Sys.Preview.Data.DataTable.parseFromJson(Result);
6
7 ....
8
9 }
Problem is, that in that _onSucceeded function, property this._TargetListBoxID is
undefined. In function, where I made web service call, the property was ok, and I could
make instance about control.