• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Radio control in Struts

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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???
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic