Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 4002 invoked from network); 23 Jul 2006 14:47:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jul 2006 14:47:56 -0000 Received: (qmail 25154 invoked by uid 500); 23 Jul 2006 14:47:49 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 25139 invoked by uid 500); 23 Jul 2006 14:47:49 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 25128 invoked by uid 99); 23 Jul 2006 14:47:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jul 2006 07:47:49 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [69.93.53.226] (HELO admin.mesanetworks.net) (69.93.53.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Jul 2006 07:47:47 -0700 Received: from [65.175.0.109] (helo=[192.168.0.101]) by admin.mesanetworks.net with esmtp (Exim 4.52) id 1G4fEp-0002mt-IW for users@cocoon.apache.org; Sun, 23 Jul 2006 08:47:23 -0600 Message-ID: <44C38BF3.8020200@lojjic.net> Date: Sun, 23 Jul 2006 08:47:15 -0600 From: Jason Johnston User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: checkbox widget with datatype vector References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-cPanel-MailScanner-Information: Please contact the ISP for more information X-cPanel-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-cPanel-MailScanner-SpamCheck: X-cPanel-MailScanner-From: cocoon@lojjic.net X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - admin.mesanetworks.net X-AntiAbuse: Original Domain - cocoon.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - lojjic.net X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Andrew wrote: > Hi, > I have a shopping cart system which enables a user to select a number of > items from their cart and delete them at the same time. This was working > perfectly before I chnaged everything to widgets because I need to use > ajax. What is happening now is that no matter how many items you select > to delete, only one item is ever deleted at a time. Now I suspect that > the problem lays with the datatype being used in fd: > > > // I tried boolean and nothing was > being deleted > > > widget definition is: > > > > I'm guessing that this is displayed multiple times using a JX forEach loop, rather than a repeater? I think just using an fd:multivaluefield should work; the widget will take care of parsing the multiple values from the request into an Array object. That would also simplify your flowscript since you'll always get an Array rather than having to do the if/else for single vs. multiple selection. However, usually multivaluefield widgets have their individual checkbox items generated from a selection-list, rather than by iterating manually and calling ft:widget multiple times with different values. I'm not sure how your approach will work with AJAX updates since it's a nonstandard use of the widget. > flow: > > delItems = bizData.delItem ; > var items = new java.util.Vector(); > > if (parseInt(bizData.quantity) || delItems != null) { > try { > > if (delItems != null) { > > if (delItems.iterator) { // A list of delItems have > been selected to be deleted. > items.addAll(delItems); > deleteOrderItem2(items); > } else { //A single delItem has been selected to be > deleted. > items.add(delItems); > deleteOrderItem2(items); > } > } > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org