[Seaside] select tag on forms

Julian Fitzell julian at beta4.com
Thu Jun 12 14:48:00 CEST 2003


Brian Brown wrote:
> I would like to build a couple method modelled after WAHtmlBuilder>>list: and 
> list:do: for building selection lists.. I was thinking one would just take a 
> collection of items to be displayed and another would take two collections, 
> one with the display items and one with separate values.....
> 
> so:
> 
> html select: #(1 2 3 4).
> 
> would yeild:
> <select>
> 	<option>1</option>
> 	<option>2</option>
> 	<option>3</option>
> 	<option>4</option>
> </select>
> 
> and
> 
> html select: #('One' 'Two' 'Three' 'Four') values: #(1 2 3 4).
> 
> would yeild:
> <select>
> 	<option value="1">One</option>
> 	<option value="2">Two</option>
> 	<option value="3">Three</option>
> 	<option value="4">Four</option>
> </select>
> 
> and maybe a third option that would also allow you to specify which one should 
> be selected....
> 
> Is there a better way to think about this? Or is there already some mechanism 
> for doing this in seaside?

Well there are the methods on WAHtmlRenderer starting with 'select'... 
is there a reason you specifically need them on Builder instead of 
Renderer?  I agree that there *should* be methods on Builder and that 
Renderer should use those, but that's another issue.

Also, if you were going to implement that, I would suggest using 
associations rather than having two lists.

Julian



More information about the Seaside mailing list