struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sudheshna aaa" <sudhes...@hotmail.com>
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">
		 <tr>
		  <td>
		   <html:multibox property="selectedPreferences">
		    <bean:write name="preference" />
		   </html:multibox>
		  </td>
		  <td class="radioLabel">
		  <%.....


And in the Action class:
			form.setPreferences(preferences);
			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 <rsk@email.arizona.edu>
>Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
>To: Struts Users Mailing List <user@struts.apache.org>
>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 
>IMO.
>
>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
>>page?
>>
>>Thanks,
>>With Regards,
>>Latchoumi.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

_________________________________________________________________
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1/go/onm00200362ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message