how to by default checked radio button in struts html tag library
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abhishek_Agrawal
Posted On:   Friday, October 7, 2005 08:19 AM



how can i bydefault checked radio button as in
html i can like



reply soon

Re: how to by default checked radio button in struts html tag library

Posted By:   alan_do  
Posted On:   Friday, October 7, 2005 11:00 AM

using html:radio, struts should automatically checks the radio button if the value of the form-bean is set. you can set the 'initial' attribute of the form-property in the form-bean definition of the struts-config.xml...e.g intitial="j".


if you are not using DynaActionForm, simply default the value when declaring the variable, e.g String r = "j"; .


you can also initialize form-bean value using form.set("r","j"); where 'form' is the local reference to the mapped form-bean to the action class.

About | Sitemap | Contact