struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Dunn" <greg.d...@nisc.cc>
Subject RE: HTML Checkbox...
Date Wed, 15 Jan 2003 22:22:27 GMT
That's be great, but whenever I try to search it I get "Text search not
available for this list"  Pretty useless.  I'm not paging through 60000
posts looking for an answer.


Greg


-----Original Message-----
From: James Childers [mailto:jchilders@hotels.com]
Sent: Tuesday, January 14, 2003 4:32 PM
To: Struts Users Mailing List; jbateman@tinyntubby.com
Subject: RE: HTML Checkbox...


Check the archives. This is another one of those questions that gets asked
(and answered) frequently.

http://nagoya.apache.org/eyebrowse/SearchList?listName=struts-user@jakarta.a
pache.org

Or try the JGuru Struts FAQ:

http://www.jguru.com/faq/printablefaq.jsp?topic=Struts

The short answer is: You're trying to set this in the wrong place. IMO, you
should be setting the default value of your form items in your ActionForm,
not the JSP tag.

Ex:

public class YourForm extends ActionForm {
	private String someCheckBox = "true";	// This sets the default value

	// getters and setters for same; will get called after form submission

	public void reset() {
		someCheckBox = "false";			// Need this here to handle submission of
unchecked boxes
	}
}

In your JSP:

<html:form action="someAction"> <!-- This Action, of course, uses
YourForm -->
	<html:checkbox property="someCheckBox" /> <!-- Will be checked since you
set it to true in your ActionForm -->
</html:form>

-= J

> -----Original Message-----
> From: John Bateman [mailto:jbateman@tinyntubby.com]
> Sent: Tuesday, January 14, 2003 3:51 PM
> To: Struts Users Mailing List
> Subject: HTML Checkbox...
>
> Hi
>
> I read the docs but I can't seem to find a way to render this button
> 'checked' when I try and display it.
>
> I've tried:
>
> <html:checkbox name="something" value="true"/>
> <html:checkbox name="something" value="yes"/>
> <html:checkbox name="something" value="YES"/>
>
> And neither of them work.
>
> Thanks
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>

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




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


Mime
View raw message