Can't use Atlassian AUI in my plugin

Hi,

I’m trying to use Atlassian AUI in my new plugin project and can’t make it work with Atlassian AUI properly.
I’m working on list project names in a select list and following the tutorial at AUI Select2 - AUI Documentation
I want to show select list with design in tutorial. But it does not seems like it.

Here is my code for list project names:

<form id="admin" class="aui">
        <select id="select2-example2">
            <option value="null"> Please select a project </option>
                #foreach( $pName in $pNames )
                    <option value="$pName"> $pName </option>
                #end
        </select>
</form>

Here is the result (screenshot):

Additional note: I added $webResourceManager.requireResource(“com.atlassian.auiplugin:aui-select2”) # line at the top of my Velocity Template but there is no difference.

Looking for your help.

Hi @AliMert

i don’t see JS code in your “source”, please add JS code from example.

AJS.$("#select2-example2").auiSelect2();

Cheers
Adam

Hi,

Thanks for your answer. But I don’t know where should i add this JS code. Can you give an example?

Sorry for my probably silly questions, I’m new at development stuff. :neutral_face:

Hi @AliMert

this is not a representative example, but it should work

<form id="admin" class="aui">
        <select id="select2-example2">
            <option value="null"> Please select a project </option>
                #foreach( $pName in $pNames )
                    <option value="$pName"> $pName </option>
                #end
        </select>
</form>

<script>
AJS.$("#select2-example2").auiSelect2();
</script>

Cheers
Adam

1 Like

Hi @adam.labus,

It works, thanks for your time and answer.

Have a nice day!
Ali Mert