Hi,
I am using the autocomplete by referring the sample code on the ebase ui sample.
When with static array as source, it works.
When change to web service, I can see the web service respond ok, I can see $(xml).text() using alert.
However, the promote does not show.
I am not sure what is the problem.
The jquery and jquery ui is 1.8.3
Thank you
Autocomplete does not work (stopped working)
Moderators: Jon, Steve, Ian, Dave
-
xren
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
-
Steve
- Moderator

- Posts: 423
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
-
xren
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
Hi Steve,
here is the code:
The bold text is the alert for debugging, the content showed correctly, however, the list would not show up under the field with autocomplete. When I use an array as source, it works fine.
$(document).ready(function(){
$(".phySearch").autocomplete({
source: function(request,response){
var soapEnv = "<xml>"
+"<soap>"
+"<soap>"
+"<ebas>"
+"<ebas>string</ebas>"
+"<ebas>string</ebas>"
+"</ebas>"
+"</soap>"
+"</soap>";
alert(soapEnv);
$.ajax(
{
url: 'http://localhost:3080/ufs/integration/rehab_phy_search',
type: 'POST',
dataType: 'xml',
data: soapEnv,
success: function(xml){
alert($(xml).text());
response($(xml).find('[nodeName="ebas:PHY_LIST"]').map(function(item){
return {
label: $(this).find('[nodeName="ebas:LASTNAME"]').text(),
value: $(this).find('[nodeName="ebas:LASTNAME"]').text(),
phyID: $(this).find('[nodeName="ebas:PHY_ID"]').text()
}//end return {
})); //end response
},//end success
failure: showError,
contentType: "text/xml; charset=\"utf-8\""
});//end ajax
},
here is the code:
The bold text is the alert for debugging, the content showed correctly, however, the list would not show up under the field with autocomplete. When I use an array as source, it works fine.
$(document).ready(function(){
$(".phySearch").autocomplete({
source: function(request,response){
var soapEnv = "<xml>"
+"<soap>"
+"<soap>"
+"<ebas>"
+"<ebas>string</ebas>"
+"<ebas>string</ebas>"
+"</ebas>"
+"</soap>"
+"</soap>";
alert(soapEnv);
$.ajax(
{
url: 'http://localhost:3080/ufs/integration/rehab_phy_search',
type: 'POST',
dataType: 'xml',
data: soapEnv,
success: function(xml){
alert($(xml).text());
response($(xml).find('[nodeName="ebas:PHY_LIST"]').map(function(item){
return {
label: $(this).find('[nodeName="ebas:LASTNAME"]').text(),
value: $(this).find('[nodeName="ebas:LASTNAME"]').text(),
phyID: $(this).find('[nodeName="ebas:PHY_ID"]').text()
}//end return {
})); //end response
},//end success
failure: showError,
contentType: "text/xml; charset=\"utf-8\""
});//end ajax
},
0 x
-
Steve
- Moderator

- Posts: 423
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
- Wai
- Moderator

- Posts: 165
- Joined: Wed Sep 12, 2007 9:04 am
- Location: Sandy, UK
- Contact:
Hi Xiaoli,
In your soapEnv, does it contain the required message? I take it you have removed the content for posting on this forum?
Make your script appears after JQuery Core and UI libraries.
Also, are you getting and passing a search form field? For example:
In your soapEnv, does it contain the required message? I take it you have removed the content for posting on this forum?
Make your script appears after JQuery Core and UI libraries.
Also, are you getting and passing a search form field? For example:
Code: Select all
var searchword =$(".search").val();
var soapEnv = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
+ "<soap-env:Envelope xmlns:soap-env='http://www.w3.org/2003/05/soap-envelope'>"
+ "<soap-env:Body>"
+ "<ebas:searchLocalPTRequest xmlns:ebas='http://www.ebasetech.com'>"
+ "<ebas:QRY>"+searchword+"</ebas:QRY>"
+ "</ebas:searchLocalPTRequest>"
+ "</soap-env:Body>"
+ "<soap-env:Envelope>";
0 x
-
xren
- Ebase User
- Posts: 272
- Joined: Fri Dec 14, 2012 2:55 pm
- Location: Ottawa
Who is online
Users browsing this forum: Bing [Bot] and 40 guests