[Seaside] Two part input.

Lukas Renggli renggli at gmail.com
Mon Feb 8 19:54:43 UTC 2010

> renderInputOn: html
>        html select
>                id: self labelId , 'predefinedOptions';
>                addAll: self predefinedOptions;
>                callback: [:v | self take: v ];
>                selected: ((self predefinedOptions includes: self string) ifTrue:
> [self string] ifFalse: [nil]).
>        html textInput
>                callback: [:v | self take: v ];
>                id: self labelId;
>                value: ((self predefinedOptions includes: self string) ifTrue: ['']
> ifFalse: [self string]).
> take: anObject
>        anObject isEmpty ifFalse: [self string: anObject ]
> predefinedOptions
>        ^ self description propertyAt: #predefinedOptions ifAbsent:[Array new.]
> That works, but is very unelegant, since it relies of the order of
> inputs, for example. Anyone a better Idea how to update using two
> callbacks at once? ^^

Earlier versions on Seaside had the possibility to add a special menu
item to the select list that popped up an input box asking the user
for a new value. Then the Javascript code modified the form so that it
would display and submit the custom value correctly.

The infrastructure is still in the Magritte model, see #beExtensible
and #isExtensible on MASingleOptionDescription. It is not anymore in
Seaside and Magritte-Seaside though, but I guess you could dig it out
again if needed.


Lukas Renggli

More information about the seaside mailing list