[Seaside] RE: [ADD] WASelectTag>>enablementBlock
boris at deepcovelabs.com
Tue Mar 27 20:24:55 UTC 2007
One additional improvement to follow up is the change that makes sure
that single-selection lists don't try to render multiple 'selected'
options (in my case, top 15 countries where we ship appear as duplicates
in a separate group on top of the list, but are repeated again further
down for consistency),
I bet Outlook will mess up the format big time, my apologies,
| brush registeredSelection |
[brush := (html option)
selected: selected isNil;
self hasCallback ifTrue: [brush callback:
[callbackBlock value: nil]].
brush with: optionalLabel].
registeredSelection := false.
brush := html option.
(self isDisabled: each) ifTrue: [brush
((self isMultiple or: [registeredSelection not])
and: [self isSelected: each])
[brush selected: true.
registeredSelection := true].
[selected add: each]
[callbackBlock value: each]]].
brush with: (self labelForOption: each)]
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
> -----Original Message-----
> From: Boris Popov
> Sent: Monday, March 26, 2007 5:27 PM
> To: 'Seaside - general discussion'
> Subject: [ADD] WASelectTag>>enablementBlock
> 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
> 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
> CONFIDENTIALITY NOTICE
> 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