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 Radio control in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Radio control in Struts" Watch "Radio control in Struts" New topic
Author

Radio control in Struts

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
I'm just creating struts application. It has a jsp having two radio buttons. But when i run this applcation. None of the radio buttons are selected Thats fine. But in that user selects both radio buttons. Here problems occur means user should actually select only one at a time. If user select other radio buttons the previos should be unselected.

Here is the code for radio button in JSP.




Please suggest me the solution.

Thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Related radio buttons should be mapped to a single property, otherwise there's no way to know they should be mutually-exclusive.
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
David thanks.I did it and it wrked. I gave it different name in property because i was refering one sample on the one site and they have used it differently but now its fine.

Can you explain me one thing regarfing html:radio

I referd one book and it says

name: "Identified a JavaBean to use when defaulting the value of input field."

What is the meaning of "...when defaulting the value of input field."

Please clear my above doubt.

Thanks in Advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you considered referring to the Struts documentation?

"The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized."
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Thanks David for your reply.

Yes, I read those perticular lines. But i'm not clear what does it mean?

Does it mean to say name of attribute or name of JavaBean???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Radio control in Struts