[Seaside] RE: [ADD] WASelectTag>>enablementBlock
rickf at ca-flower.com
Tue Mar 27 20:39:10 UTC 2007
This sounds like something I was dealing with a while back and did some
ugly hacks to deal with.. In my case I had several drop-downs with the
initial selected item being something like "select one" -- but, I didn't
want that one item actually selected.. This code sounds like it might
work in this manner.. I'll check it out -- keeps the hacks away!
Boris Popov wrote:
> 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,
> optionsOn: html
> | brush registeredSelection |
> self isOptional
> [brush := (html option)
> selected: selected isNil;
> self hasCallback ifTrue: [brush callback:
> [callbackBlock value: nil]].
> brush with: optionalLabel].
> registeredSelection := false.
> [:each |
> brush := html option.
> (self isDisabled: each) ifTrue: [brush
> ((self isMultiple or: [registeredSelection not])
> and: [self isSelected: each])
> [brush selected: true.
> registeredSelection := true].
> self hasCallback
> [self isMultiple
> [selected add: each]
> [callbackBlock value: each]]].
> brush with: (self labelForOption: each)]
More information about the seaside