0

Whenever I do something like someString = object().name + " / " object2().name; in the toString() of an object, and load the array of objects into a wicket dropDownChoice, the dropDownChoice disregards the spacing of the strings.. So I'd rather have something like:

                Role / Site 

Drop Down Menu: RoleName / SiteName

but instead no matter how much spacing I put it will always display:

RoleName/SiteName in the drop down choice... any ideas? I tried doing:

object().name + "&nbsp/&nbsp" object2() because I wasn't sure how wicket processes the string into the option tags, but that didn't work either.

any ideas?

Thanks!

eaglei22
  • 2,589
  • 1
  • 38
  • 53

2 Answers2

1

Figured it out..

doing

       toString()
       {
          return "object().name + "&nbsp/&nbsp" object2().name"
       }

        this ended up working when I called:

        ssaIDRolesDropDownList.setEscapeModelStrings(false);

        //ssaIDRolesDropDownList is a reference to my dropDownChoice
eaglei22
  • 2,589
  • 1
  • 38
  • 53
0

This has nothing to do with Wicket; Elements like dropdowns or the infamous input type="file" are rendered OS specific:

Preserve whitespace in html select element options using "white-space: pre" NOT working

Community
  • 1
  • 1
mrak
  • 2,826
  • 21
  • 21
  • actually I just figured it out.. doing the &nbsp works when I implement setEscapeModelStrings(false) on the dropdownchoice reference. Thanks though! – eaglei22 Oct 11 '13 at 00:36