cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject Re: iteration problem with flow
Date Mon, 08 Nov 2004 07:11:57 GMT
Something else to add to the docs ;-)

>>> 2004/11/06 02:28:21 PM >>>
Hi Andrew,

not sure about this but cocoon behaves the following way for multiple 

- if no checkbox is selected, you get no value, i.e. 
cocoon.request.get("delItem") is null.
- if one checkbox is selected, you get a simple value, i.e. 
cocoon.request.get("delItem") is  for example "5".
- if two or more checkboxes are selected, you get an instance of 

Only in the latter case you can use the iterator function. In the first

two cases, items.iterator() will
be undefined. So you should actually do some pre-processing like this
have a list in any case:

var items = new java.util.Vector();

    if(cocoon.request.get("delItem").iterator) // no brackets, this
checks if it has an iterator at all

This is a little nasty sometimes, but I guess it can't be implemented 
differently in cocoon.


beyaNet wrote:

> Hi,
> I have an html form which has a number of checkboxes which when 
> selected indicate that the item should be deleted from an order. All

> the checkboxes share the same name, delItem. So when the form is 
> submitted and depending on the number of items I have selected to be

> deleted, what gets posted in the form should be an array of
> [val1, val2, val3]
> So, in my flowscript which checks this value i do:
> var items = cocoon.request.get("delItem");
> var iterator = items.iterator();
> I then get an error message saying that iterator is not a function. 
> What am I doing wrong here?
> many thanks
> Andrew
> To unsubscribe, e-mail: 
> For additional commands, e-mail: 

To unsubscribe, e-mail: 
For additional commands, e-mail: 

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message