[Seaside] Indenting elements in select list

Avi Bryant avi.bryant at gmail.com
Wed Feb 2 02:00:32 CET 2005


On Tue, 1 Feb 2005 15:01:15 +0100, David Röthlisberger
<davidroe at bluewin.ch> wrote:

> I would like to fill a select list with elements, and some elements should
> be indented.
> 
> E.g.:
> element1
>   element2
>     element3
> 
> I can't prepend a white space to the strings, because this won't be
> displayed in the select list, instead I have to put some &nbsp;'s before the
> strings.

This works in Firefox but not in Safari: use whitespace, and then have
this style somewhere:

option {white-space: pre}

Alternatively I like Yar HweeBoon's suggestion of having a special
IndentedString class with its own #renderOn: implementation, although
I might just have a PreformattedWhitespace class instead - and for
convenience, add a #preformatted method to String which returns one. 
So you end up with something like this:

html selectFromList: items selected: foo callback: bar labels:
   [:ea |
   (self indentedStringFor: ea) preformatted]


More information about the Seaside mailing list