Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Success using jQuery UI autocomplete in Confluence 3.5.3

Lionel Hutz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2011

I seem to be having some difficulty using autocomplete from jQuery UI which is packaged in confluence 3.5.3. It appears that the "source" parameter is being ignored. Firebug shows my requests as a relative request to the following location:

%5Bobject%20Object%5D

I can get the same thing if I type this request:

jQuery.post({
url : "testUrl.php",
});

The request 404s but the url is inforrect. I'm guessing this must be a bug with the jQuery version confluence 3.5.3 is using? Anybody else experience this issue or have a work-around? Or can I use any autocomplete library confluence is already using? Here's my autocomplete code:

jQuery(".myautocompletes").autocomplete({
source:function( request, response ) {
jQuery.ajax({
url: AJS.Data.get("context-path") + "/plugins/myAction/myAction.action",
dataType: "json",
data: {
term: request.term
},
success: function( data ) {
return response;
}
});
},
minLength: 2
});

(I've also tried with 'source: "/plugins/myAction/myAction.action"'.)

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Lionel Hutz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 17, 2011

I've realized the autocomplete I was using was Atlassian's which is actually used to find users. From the minimized code it looks like I won't be able to re-use it so I'm going to use this instead:

http://www.codenothing.com/archives/jquery/auto-complete/

TAGS
AUG Leaders

Atlassian Community Events