In development of Confluence plugin, how to add a textbox in UI that supports autocompletion?

Khon November 28, 2017

Hi everyone,

I am developing an application based on Confluence plugin. There is one feature that requires the UI textbox to supports the auto completion of user name. In the backend, we need to retrieve the list of user email addresses submitted from UI. 

What is the hint / documentation to achieve the above effect? I did try to research by googling and searching in Atlassian forum with keyword like autocompletion for plugin development, but it has no result.  :(

Thank you very much!

Khon

1 answer

0 votes
miikhy
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.
December 1, 2017

Hi Khon,

There are multiple options, I would definitely recommend you use AUI objects (Atlassian User Interface framework). The Select2 is the one I use for my plugins, you can preload users and add options to the select2, it will then support autocompletion based on the value displayed in the option. You can also setup the select2 to be fed from a REST Resource (might be compliant with expected format though).

Documentation here: https://docs.atlassian.com/aui/latest/docs/auiselect2.html

Please note that it must be dependency-injected in your web resources!

If you're familiar with Javascript, it's a very easy and flexible object. The documentation of the original object is here: https://select2.org/ AUI is bringing a design layer but behaviour is the same!

Hope this helps!

miikhy
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.
December 1, 2017

If you want to retrieve email, I'd advise you to use email as id and Name and/or other details as value so that selecting a value would give you the email directly :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events