Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 12576 invoked from network); 12 Jul 2009 23:38:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jul 2009 23:38:17 -0000 Received: (qmail 5808 invoked by uid 500); 12 Jul 2009 23:38:24 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 5749 invoked by uid 500); 12 Jul 2009 23:38:24 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 5731 invoked by uid 99); 12 Jul 2009 23:38:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jul 2009 23:38:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of musachy@gmail.com designates 209.85.212.178 as permitted sender) Received: from [209.85.212.178] (HELO mail-vw0-f178.google.com) (209.85.212.178) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jul 2009 23:38:14 +0000 Received: by vwj8 with SMTP id 8so1583912vwj.23 for ; Sun, 12 Jul 2009 16:37:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=iTy6NBaVHNYzdt3+be/HPlWhdOx5bz1p/ap7i6ujoZ8=; b=iV664i4Qw7K8KeZVfo2i83pltSyTPpPoxioxYeB0ISCIMVhU/nj79UmfsQmHDB2ieB U6iQZskdD0Lu6A4QHzzirhkRN33CyCjKUSXdcOkyFT3sfbjhw8xxh2jvk+A2nFs//mgs ChtKxoQ9ps4HTI1Bdh3FVIg6VKlTzEy/q8COM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=jH0j5CjgeaZiCnLBLad4dayNFVr1rZgL2x0cOlb9NfOGq4wh0uoHQro1Y+WitW9whQ RzAPQHZ/oVsWqilL2b73O9s9SF3cKZGveMsFyiLW2jk57PhFZMQmB/j9AjkDa4k4LdS1 cmoDq/H5HhhEw60KVjU5Mm07vc0czxXnQxWVU= MIME-Version: 1.0 Received: by 10.220.46.10 with SMTP id h10mr6314383vcf.8.1247441873074; Sun, 12 Jul 2009 16:37:53 -0700 (PDT) In-Reply-To: <24452969.post@talk.nabble.com> References: <24452969.post@talk.nabble.com> Date: Sun, 12 Jul 2009 16:37:53 -0700 Message-ID: Subject: Re: s:checkbox inside a s:iterator and values in a Integer[] From: Musachy Barroso To: Struts Users Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org you need to specify the "value" attribute, which is the one that will make it checked or not, for example, assume "possibleValues" is the list of possible values, and "selectedValues" is the list of currently selected values, and both lists contain objects that have an int "id" field (same type of objects): musachy 2009/7/12 Ignacio de C=F3rdoba : > > Hello, > I've browsed nabble, google, ... but can't find a simple example on how t= o > do something very simple. > > I need to iterate through, let's say, a picture category list, showing ea= ch > category as a s:checkbox. The picture belongs to some of these categories > (and user can changed that, or course, thanks to the checkboxes), so some= of > the checkboxes must be pre-checked. Which of them are checked is shown in= a > Integer[] (could be String[] if necesary, no problem). I guessed the righ= t > way to do it is using a String or Integer array as checked values will be > sent to the struts2 action through that same property. > Is it that difficult to use s:checkbox for this? I know how to do it usin= g > s:checkboxlist but can't here as I need special format in the iteration. > > For some reason the following: > > label=3D"%{name}"/> > > > (categoryId is a Integer[] having which id values should be checked but a= ll > checkboxes appear as checked) > > For some reason I've found more people with this same problem but they go= t > no answers. Thanks for any example or ideas if I must change the way > pre-checked data is got from the action. > Ignacio > -- > View this message in context: http://www.nabble.com/s%3Acheckbox-inside-a= -s%3Aiterator-and-values-in-a-Integer---tp24452969p24452969.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --=20 "Hey you! Would you help me to carry the stone?" Pink Floyd --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org