Question

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!

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top