I've noticed strange behavior with switch too (using Cocoon 2.1.5.1)...
for me, I was able to get it to work by making sure the object being
tested is a JavaScript String, as opposed to a Java String, e.g.:
switch (String(shapeId)) {...
I realize that doesn't solve the inconsistency issue between versions,
but might help for your app in the short term.
--Jason
On Fri, 2005-03-11 at 09:50 +0100, Bertrand Delacretaz wrote:
> This has been discussed on users@ already [1], just wanted to note it
> here FYI.
>
> Specifically, flowscript code such as
>
> var shapeId = cocoon.request....
> switch (shapeId){
> case "square":
> // dosomething
>
> did not dosomething anymore when shapeId=="square", although it worked
> in past releases (in the "shapes" sample of the tour block).
>
> I've changed it to if/else to be on the safe side (also in the trunk),
> and in [1] Reinhard mentions that the new Rhino fixes this. Dunno since
> when this is broken, but it might mean a small incompatibility between
> 2.1.x releases.
>
> -Bertrand
>
> [1]
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110865972811342&w=2
>