Wednesday, March 21, 2012

Defining 2nd Autocomplete Textbox

How would you define a second autocomplete textbox? Below is how I did it and I have two seperate div tags for the drop downs.
Seems like the memory isn't cleared or something like that because the second drop always seems to call the first drop downs method or at least produce a list as if it called the first drop downs method.

<scripttype="text/xml-script">

<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">

<references>
<add src="ScriptLibrary/AtlasUI.js" />
<add src="ScriptLibrary/AtlasControls.js" />
</references>
<components>
<textBox id="SearchKey">
<behaviors>
<autoComplete
completionList="completionList"
serviceURL="AutoCompleteService.asmx"
serviceMethod="GetWordList1"
minimumPrefixLength="2"
completionSetCount="15"
completionInterval="500" />
</behaviors>
</textBox>

<textBox id="SearchKey1">
<behaviors>
<autoComplete
completionList="completionList1"
serviceURL="AutoCompleteService.asmx"
serviceMethod="GetAppList"
minimumPrefixLength="2"
completionSetCount="15"
completionInterval="500" />
</behaviors>
</textBox>
</components>

</page>

</script>
Thanks for any help,
Clank

On top in the Web Service code, find this line..

privatestaticstring[] autoCompleteWordList =null;


I guess u must be storing the 2nd result also in this same member. Change this to

privatestring[] autoCompleteWordList =null;

It should work now.
Thanks, that fixed my problem.

No comments:

Post a Comment