[Seaside] Drag and drop between two select's?
renggli at gmail.com
Thu Oct 11 07:14:58 UTC 2007
> * I want to be able to drag and drop items boths sides of two <select>
> lists, and if possible, both to be sorted.
I don't think that can possibly work. Select lists are form elements
that some famous browsers even render as native widgets. Absolute
drag-and-drop code will hardly ever work in a cross browser compatible
I suggest that you use an #unorderedList for the drag-and-drop and
apply some decent CSS styles to make it look like a select-list. I
guess it should be fairly easy to make it match the look and
functionality of a select-list.
> * I've seen examples using simple xhtml lists (#unorderedList), but not
> using xhtml <select> with <option>'s as items. AFAIK, the difference is
> using a list you're in control of the rendering of an item (see
> #renderInventoryOn: or #renderListItems: On: ) but using a select, how do I
> specify the #passenger: for each <option>?
Exactly the same way you manually render an #unorderedList. Both tags
(<ul> and <select>) essentially support the same protocol with #list:,
#selected:, #callback:, etc. Elements that you specify using #list:
are added automatically, but you always have the possibility to do
your own thing. For details on how to make the callbacks work have a
look at WASelectTag>>#renderListItem:labelled:
More information about the seaside