[Seaside] [ANN] [VW] Seaside 2.7b1 ready for VW

Michel Bany m.bany at wanadoo.fr
Thu May 3 07:49:12 UTC 2007


Forgot to mention another issue regarding compatibility of Seaside 2.6 
components.

For textInput and textArea elements, Seaside 2.6 supplies a converted 
value to the callback, not necessarily a string. The conversion is 
completely transparent.

For instance, if a textInput element is initialized with a number, then 
the callback is evaluated with a number, if it was initialized with nil 
and if it is not modified by the user, then the callback is evaluated 
with nil.

See #fromStringConverterBlockFor:callback: and #convertSeasideString:
This behavior, although implemented differently, was also in Seaside 2.5.
In Seaside 2.6, this behavior is available in both the canvas and old 
renderers.

In Seaside 2.7, this behavior is still available for the old renderer. 
However the transparent conversion has been removed from the canvas 
rendering.

In Seaside 2.7, the value supplied to the callback is always a string 
for the canvas renderer. When upgrading to Seaside 2.7, it may be 
necessary to revise the textInput and textArea callbacks in existing 
components that use the canvas renderer. The same applies when migrating 
a component from old renderer to canvas.

See below some more explanations from Lukas.

Cheers,
Michel.



On 23 Feb 2007, at 09:05 , Lukas Renggli wrote:

This code was intentionally dropped a long time ago as it does harm more 
than it helps. Let me try to explain.

Before the semantics were clear: the callback block always gets 
evaluated with a string. Manual validation and conversion can be done by 
the user exactly the way he requires. With Seaside trying to be smart 
the callback sometimes gets evaluated with a Number, sometimes with a 
String. Now the user has to do much more to ensure a consistent state of 
his model: not only he has to do the validation and the conversion but 
also some ugly type checking. There is a chance that Seaside drops some 
important data due to its implicit conversions.

I always try to avoid as much implicit behavior as possible, as it makes 
it very difficult to understand the code and causes very hard to detect 
bugs. Moreover a conversion by Seaside completely breaks any 
meta-framework (and I am sure this is not only Magritte) that depends on 
getting exactly the result as the user typed it and not some 
pre-processed data.



More information about the Seaside mailing list