[Seaside] Type conversions for form models using WALabelledFormDialog subclasses

radoslav hodnicak rh at 4096.sk
Thu Sep 30 19:51:56 CEST 2004


On Thu, 30 Sep 2004, Avi Bryant wrote:

> The built in textInput methods (ie, #textInputWithValue:callback:) try
> to be pretty smart about this.  You can give them anything and it'll
> display asString, except nil which will display as an empty string. If
> you give them a number as the value, they'll give you a number back in
> the callback.  If you give them a string, you'll get a string back,
> including possibly an empty string.  If you give them a nil, you'll get
> back either a non-empty string (if the user enters one) or nil (if the
> user enters an empty string).

That was one of the very first things I changed in seaside - see if you
give it a nil, you get nil back when the user enters nothing. But if there
was some value and the user deletes it you'll get back empty string, not
nil. Makes checking for empty fields rather silly. I have separate
renderer methods for every input element where seaside does conversion
that only forward the string and let the model handle it instead (e.g. I
can created scaled integers from numbers with decimal point/comma instead
of floats etc)

rado



More information about the Seaside mailing list