File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes No Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No "CHECKED" feature for html:radio ?" Watch "No "CHECKED" feature for html:radio ?" New topic
Author

No "CHECKED" feature for html:radio ?

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
I searched the struts html tag API, but htmal:radio, there is no such a thing that matches to "CHECKED" in html's radio tag. How can we set it as default checked ?
Steve Li
Greenhorn

Joined: Jun 29, 2005
Posts: 5
Try

Thank you
Steve
Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
Originally posted by Steve Li:
Try

Thank you
Steve



You completely get me wrong. I am not asking for "check box", I was asking how to do the following html --

<type="radio" name="card" value="123" CHECKED/>
<type="radio" name="card" value="abc" />
<type="radio" name="card" value="xyz />

How to make that first line "CHECKED" syntax appear if I use html:radio tag ?
Rashmini Palakurti
Greenhorn

Joined: Jun 29, 2005
Posts: 13
In html:radio there's no CHECKED attribute , that feature can be implemented by setting default value to the associated property in ActionForm.

For Example:

If u have something like this in ur JSP :

<html:radio property="gender" value="M">Male</html:radio> ---1
<html:radio property="gender" value="F">Female</html:radio>---2

then u can set 1 control as checked by initialising gender property to "M" in ur ActionForm or if u want to do it at run-time in Action class then u can do it by the setProperty of Gender.
 
 
subject: No "CHECKED" feature for html:radio ?