[Seaside] [ADD] WASelectTag>>enablementBlock

Boris Popov boris at deepcovelabs.com
Tue Mar 27 00:27:09 UTC 2007

If you ever needed to build a list with certain elements that aren't
supposed to be selectable, here's a change that lets you do the

(html select)
 list: self countyChoices;
 selected: self country;
 enablementBlock: [:ea | ea notNil];
 labels: [:ea | ea
                 ifNil: ['-----------------------------']
                 ifNotNil: [ea description]];
 callback: [:value | self country: value]

where #countryChoices returns a collection of countries separated by nil
into section with most popular countries and the rest underneath.


WASelectTag>>enablementBlock: aBlock
 enablementBlock := aBlock

WASelectTag>>isDisabled: option
 ^enablementBlock notNil and: [(enablementBlock value: option) not]

WASelectTag>>optionsOn: html
 brush := (html option)
		disabled: (self isDisabled: each);
		selected: (self isSelected: each);

Hope this gets integrated at some point :)



DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

boris at deepcovelabs.com


This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any

Thank you.

More information about the seaside mailing list