Are there repository hook examples for more complex configuration UI? has some nice examples. Are there any examples that better illustrate how to do more complex soy UI components like select/dropdown lists, checkboxes, and similar that include how to tie it in with java code like the simple text examples provided?

2 answers

1 accepted

1 vote
Accepted answer
Jonathan Poh Atlassian Team Apr 04, 2013

Hi Bob,

for the input field widths, AUI provides 4 preset sizes which you can use by setting the class on the input

short-field (75px)

medium-field (165px)

long-field (500px)

full-width-field (full width of the container element)"text",type="password"),select,textarea

eg in your Soy template you'd put this line inside any of the aui.form.* form elements:

{param extraClasses: 'long-field' /}

or as Charles suggested, you can also add your own class and style that to exactly the width you need. Just be aware that AUI sets the width of the fields to 100% and constrains it by setting the max-width.

Perfect! I saw that earlier in the AUI info but didn't know how to make that work with the soy template. It worked right away for the aui.form.textarea field. Didn't work for aui.form.textField but changing to use aui.form.input instead work as expected. Thanks again!

1 vote
Seb Ruiz Atlassian Team Apr 01, 2013

Unfortunately the AUI docs which are linked to are a little sparse on how to call the soy templates which it exports.

Good examples might be the the following plugins which provide form data in Stash pages:

None of these are hook plugins, but the logic is all there to pass information back to your servlet.

Thank you. I will have a look soon.

Your links spawned more questions :). I tried some trial and error coding without much success. I was able to get a checkbox to work in addition to the text field.

{call widget.aui.form.checkbox}
    {param id: 'xxx' /}
    {param labelHtml: 'XXX' /}
    {param checked: $config and $ /}
    {param description: 'XXX desc' /}

  1. Is there a list of valid widgets and what parameters are valid for each?
  2. Is there and and what are the parameters?
  3. What is the difference between and For instance, I use widget.aui.form.checkbox and aui.form.textField (based on the examples I have found)
  4. What is widget.aui.form.form? I am not sure I noticed a difference when other elements were included in that.
  5. The text field seems to have a size parameter but doesn't have any affect on the size of the input field. How do you set the input field size?
  6. The text field seems to have a description parameter but doesn't have any affect. Is there a way to have a description underneath the input field?
Jason Hinch Atlassian Team Apr 03, 2013 are Stash's internal soy templates which are implementations of the AUI spec for how forms should look. is a more recent experimental API added into AUI which is an implementation of the same spec. the latter is the prefered option for plugin developers to use as we will be soon removing The parameters between the two sets of templates are different which may be why you aren't seeing the changes. It also may be a caching issue in the browser. In terms of the available parameters your best option currently is to look at the source code.

Thanks. I think I am starting to understand reading the code you pointed at better. I have looked there before, but now I know that is the reference I should look to. I converted my checkbox to remove the widget, but had to stick with widget.aui.form.form as aui.form.form results in a blank dialog. I still can't get the select to work even if I pretty much copy the example options setting. What is the correct soy syntax for specifying options (a tree of nodes)? This does not work:

    {param id: 'myselect' /}
    {param size: 1 /}
    {param options: [
        [ text : 'My Option 1', value : '1' ],
        [ text : 'My Option 2', value : '2', selected : true ]

Hi Bob,

For options you need to quote the key name as well:

    {param id: 'myselect' /}
    {param size: 1 /}
    {param options: [
        [ 'text' : 'My Option 1', 'value' : '1' ],
        [ 'text' : 'My Option 2', 'value' : '2', 'selected' : true ]



Thanks for all the help. Almost there.

  1. aui.form.form problem was the need to convert the parameter: contents -> content
  2. Charles comment fixed the soy syntax error
  3. Using aui.form.fieldGroup helps with labeling and setting descriptions
  4. The only remaining problem is the size. The input fields are too small, only about 1/2 the dialog size. Setting size parameter on textField or textarea has no affect.

Hi Bob,

If you're using the AUI templates then size should work for textField (but not for textArea by the looks of it). Can you see a 'size' attribute in the generated HTML?

Looking at a text element in Chrome Dev Tools I can see we actually apply a width of 100% and a max-width of 250px, which might be why you're not seeing it actually change. You might want to apply you own class (using 'extraClasses' or style through 'extraAttributes' ) and set the width there.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

660 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you