cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Johnson <bljohn...@gmail.com>
Subject Flow: Typeof with Checkboxes
Date Wed, 13 Apr 2005 14:39:16 GMT
I'm sure this is a simple question, I've searched the mailing list and
haven't seen anything at least related to my keywords.

I have a set of checkboxes like this:
<input type="checkbox" name="types" value="someidcode1"/>Something 1
<input type="checkbox" name="types" value="someidcode2"/>Something 2
<input type="checkbox" name="types" value="someidcode3"/>Something 3

If I select multiple checkboxes the flowscript returns a
java.util.Vector when accessing cocoon.request.get("types").  But if I
only select one checkbox it returns a string.  If I try something like
the following I get an error if I select multiples:

if (typeof(cocoon.request.get("types")) == "string") {
    ...some code here...
} else {
   ...more code here...
}

And, of course, if I select a single one without doing this check and
I try to access a size() method I get an methodnotfound error since
the return type is string.  Any way I can force it to always return a
Vector, or is there a better way of type checking?  I could always
just trap the exception, but that just doesnt seem like a good idea.

Thanks,

- Brent

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message