[Seaside] WASelectTag - html select question

Lukas Renggli renggli at gmail.com
Mon Mar 23 18:18:53 UTC 2009

> I'm new to both Seaside and html so this may be a dumb question but here
> goes.  It seems that when one wants an html "select" (that will return the
> selected item) and the list is a collection of Associations, the "value"
> part of the "option" is generated by Seaside and the displayed list item is
> the #value of the Association.  It would be nice if the "value" part of the
> "option" was the #key of the Association.

Seaside takes care of the value attribute of option tags, similar as
it does with all other names on a page. This is to ensure uniqueness,
even if different components or multiple instances of the same
component are displayed at once.

If you really want to specify your own names/values and if you don't
need the Seaside callbacks on these elements, feel free to run your
own rendering along the following lines:

html select: [
   aDictionary keysAndVauesDo: [ :key :value |
       html option
           value: key;
           with: value ] ]

Generally it is a better idea to use CSS classes to identify different
kind of DOM elements from Javascript.


Lukas Renggli

More information about the seaside mailing list