Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 33586 invoked from network); 12 May 2006 13:32:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 13:32:39 -0000 Received: (qmail 75339 invoked by uid 500); 12 May 2006 13:32:36 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 75267 invoked by uid 500); 12 May 2006 13:32:36 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 75255 invoked by uid 99); 12 May 2006 13:32:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 06:32:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2006 06:32:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2D8AE714291 for ; Fri, 12 May 2006 13:32:09 +0000 (GMT) Message-ID: <27153956.1147440729183.JavaMail.root@brutus> Date: Fri, 12 May 2006 13:32:09 +0000 (GMT+00:00) From: "Ross McDonald (JIRA)" To: dev@cocoon.apache.org Subject: [jira] Updated: (COCOON-1697) Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops In-Reply-To: <310876949.1132781436011.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/COCOON-1697?page=all ] Ross McDonald updated COCOON-1697: ---------------------------------- Attachment: FOM_RequestParameters-2.1.9.patch.txt second part of the patch for this issue, implemented and tested with cocoon 2.1.9 > Allow request parameters to be used in "for (var k in h)" kind of Javascript Loops > ---------------------------------------------------------------------------------- > > Key: COCOON-1697 > URL: http://issues.apache.org/jira/browse/COCOON-1697 > Project: Cocoon > Type: Improvement > Components: * Cocoon Core, - Flowscript > Versions: 2.1.8 > Reporter: Pier Fumagalli > Priority: Minor > Attachments: FOM_Cocoon-2.1.9.patch.txt, FOM_RequestParameters-2.1.9.patch.txt, patch.txt > > As far as I can see, in the "cocoon" object passed to the flow environment, I always have to access the request parameter names and all values as Java Enumeration(s), therefore, I can't use the "for (var name in array)" kind of loop. > All I want to do is something extremely simple, like this: > for (var name in cocoon.request.parameters) { > print("PARAMETER -> " + name); > print(" VALUE -> " + cocoon.request.parameters[name]); > print(" LENGTH -> " + cocoon.request.parameters[name].length); > for (var position in cocoon.request.parameters[name]) { > var value = cocoon.request.parameters[name][position]; > print (" @[" + position + "] => " + value); > } > } > Apparently, but I might have overlooked something, there's currently no way of doing this. > I've created a simple patch, that allows the above mentioned flowscript to work. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira