Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 26462 invoked from network); 1 Dec 2004 19:15:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Dec 2004 19:15:27 -0000 Received: (qmail 15274 invoked by uid 500); 1 Dec 2004 19:14:46 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 15240 invoked by uid 500); 1 Dec 2004 19:14:46 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: 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 15203 invoked by uid 99); 1 Dec 2004 19:14:46 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS,HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web53205.mail.yahoo.com (HELO web53205.mail.yahoo.com) (206.190.39.221) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 01 Dec 2004 11:14:44 -0800 Received: (qmail 49504 invoked by uid 60001); 1 Dec 2004 19:14:41 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=xHAbQnWgGHflPhTpfiY7bGlabxImGGl+v5W5MGDlAAuzNcTaIbXhzKq98uBZX53KB6l/kvwIak0VSAggRz+hA2uIWYL40LBr4+UsDtquQ6tjQGuYn9+WLAkWHWS7/8grzjEjdSEQcQGaQXTwTaX2NYfidSI/Nv039pwfPlaVmZw= ; Message-ID: <20041201191441.49502.qmail@web53205.mail.yahoo.com> Received: from [207.246.185.166] by web53205.mail.yahoo.com via HTTP; Wed, 01 Dec 2004 11:14:41 PST Date: Wed, 1 Dec 2004 11:14:41 -0800 (PST) From: t t Subject: RE: Checking radio button based on object value To: Struts Users Mailing List In-Reply-To: <003e01c4d7d6$9c01bfb0$0100a8c0@Ciaran> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-65199350-1101928481=:48710" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --0-65199350-1101928481=:48710 Content-Type: text/plain; charset=us-ascii To my opinion, using "true" and "false" as radio buttons' value is not a good idea. Try to do that as shown in my example. If your form bean's scope is"session", there should be no problem. it will reproduce what the user selected. tong Ciaran Hanley wrote: optionOne, optionTwo are two groups consisting of two buttons each. Basically each is an on and off switch, "true" or "false". I can set the default values in my form bean ok, I set them all to false initially. The problem is once updated options have been submitted and saved in the session I need to reproduce the users choices the next time they visit the same JSP. So the next time into the JSP "true" and "false" values should be checked to reflect the users options. I am trying to figure out how to do this CH -----Original Message----- From: t t [mailto:wantte03@yahoo.com] Sent: 01 December 2004 18:39 To: Struts Users Mailing List Subject: Re: Checking radio button based on object value Not sure if your optionOne and optionTwo is two groups of radio button or two radio button in one group. I give you an example to illustrate how to set default values: Suppose I have a group (group1) of radio buttons, say 3. I want to preselect the first one. In my JSP file. I do this: In the form bean file, I will have a property called "group1", and default value is "rb1" private String group1="rb1"; Hope this helps. Tong Ciaran Hanley wrote: Hi, I have a form consisting of several radio buttons. Upon form generation I need radio buttons in the form to be checked based on the attribute of a bean stored in the session. If the beans property is true then a particular radio button value of "true" should be checked. Option One Option Two I want these preselected based on a bean which has variables corresponding to each radio button boolean optionOne = false; boolean optionTwo = true; How can I achieve this? Thanks, CH --------------------------------- Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------- Do you Yahoo!? All your favorites on one personal page � Try My Yahoo! --0-65199350-1101928481=:48710--