Autocomplete does not work (stopped working)

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

Autocomplete does not work (stopped working)

#1

Postby xren » Wed Feb 27, 2013 4:42 pm

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
0 x

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

#2

Postby Steve » Thu Feb 28, 2013 9:44 am

Hi Xiaoli,

I am a little confused about what you mean in your question.

Do you have some script? And a bit more detail.

Kind regards

Steve
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Thu Feb 28, 2013 1:49 pm

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
},
0 x

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

#4

Postby Steve » Thu Feb 28, 2013 3:24 pm

Hi Xiaoli,

Sorry I am not sure about this subject.

I was wondering whether the lines:

label: $(this).find('[nodeName="ebas:LASTNAME"]').text()

should read:

label: $(this).find("LASTNAME").text();

same for value and phyID.


Not sure if that helps, but give it a try.

Kind regards

Steve
0 x

User avatar
Wai
Moderator
Moderator
Posts: 165
Joined: Wed Sep 12, 2007 9:04 am
Location: Sandy, UK
Contact:

#5

Postby Wai » Mon Mar 04, 2013 12:49 pm

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:

Code: Select all

var searchword =$&#40;".search"&#41;.val&#40;&#41;;

    			var soapEnv = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>"
										+ "<soap-env&#58;Envelope xmlns&#58;soap-env='http&#58;//www.w3.org/2003/05/soap-envelope'>"
										+ "<soap-env&#58;Body>"
										+ "<ebas&#58;searchLocalPTRequest xmlns&#58;ebas='http&#58;//www.ebasetech.com'>"
										+ "<ebas&#58;QRY>"+searchword+"</ebas&#58;QRY>" 
										+ "</ebas&#58;searchLocalPTRequest>"
										+ "</soap-env&#58;Body>"
										+ "<soap-env&#58;Envelope>";
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#6

Postby xren » Tue Mar 05, 2013 4:25 pm

Hi Wai,

The web service actually is a test one, it does not use any input but just return one row.

Xiaoli
0 x


Who is online

Users browsing this forum: Bing [Bot] and 39 guests