struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sudheshna aaa" <>
Subject Re: please clarify my doubt on Struts Checkbox
Date Tue, 27 Apr 2004 17:13:48 GMT
I have something like this in the jsp:

		 <logic:iterate  name="form" property="preferences" id="preference">
		   <html:multibox property="selectedPreferences">
		    <bean:write name="preference" />
		  <td class="radioLabel">

And in the Action class:
			if( (selectedPreferences != null))
				form.setSelectedPreferences(selectedPreferences);	//pre select

Here 'selectedPreferences' is the list of all the check boxes that needs to 
be checked. This list contains name of the check boxes that need to be 
checked. 'preferences' contains all the check boxes list.

May be this helps!

>From: Riyad Kalla <>
>Reply-To: "Struts Users Mailing List" <>
>To: Struts Users Mailing List <>
>Subject: Re: please clarify my doubt on Struts Checkbox
>Date: Sun, 25 Apr 2004 07:07:33 -0700
>I had a problem like this too... and if you check the taglib API docs for 
>checkbox, you actually NEED to set the checkbox to false in the reset() 
>method in the form in order for it to work... in my case my default was 
>checked, but I HAD to set it to unchecked in order for it to work... seemed 
>like a strange design decision to me.
>Then you can use Javascript to check the checkbox on load, but that's a PIA 
>Latchoumi Narayanan wrote:
>>Hi All,
>>I am having problems populating(checked) struts checkbox while
>>loading them in a jsp page, do some one know how to do this. I can't
>>do it as in the case of normal Html checkbox by mentioning 'checked'
>>or by any other means like setting value attribute. In the jakartta
>>FAQ's I saw an article which says to do it by configuring a
>>ActionFormBean even then I can't do this, I am able to propagate the
>>Form bean by putting it in the request of Action Class but still its
>>not working.
>>Can some one tell me how to check a Struts Checkbox while loading a
>>With Regards,
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage!

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

View raw message