Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Override AUI Single select URL Change

Jackson Farnsworth
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.
October 29, 2018

So I've added in the AUI Single Select in my JIRA plugin, and when I hit enter after making my selection, the URL changes and gains a parameter with a key that is the name of the Selector and value which was the value in the selector. However, the issue is it doesn't append, but overwrite all other parameters.

Is there a way to change whatever Javascript function is built into the element so that it will append the parameter to the existing list instead of overwriting them all?

EX:

(Desired)
https://myInstance.com/plugin/servlet/Page?q=10 
->
https://myInstance.com/plugin/servlet/Page?q=10&name=value

instead of

(What currently happens)
https://myInstance.com/plugin/servlet/Page?q=10 
->
https://myInstance.com/plugin/servlet/Page?name=value
 


AUI Element Documentation:
https://docs.atlassian.com/aui/6.0.9/docs/single-select.html

1 answer

1 accepted

1 vote
Answer accepted
Daz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2018

Hi @Jackson Farnsworth,

Going by your description, I will guess that you are adding the AUI Single Select in to its own `<form>` element and then submitting that `<form>`?

This is standard HTML form behaviour -- pressing "enter" inside a form field with a single input element will submit that form. (See the spec and this example).

If you want the value of "q" to be submitted along with the value of your single-select field, you'll need to do one of two things:

* Add the value of "q" as a hidden input field inside your single-select form, or

* Capture the "submit" event of the form with the single select field in it with JavaScript, add the value of "q" to the data, and submit the request manually.

Hope that helps!

- Daz

Suggest an answer

Log in or Sign up to answer