java - Use radio button instead of drop down/OptionsCollection -


i need modify code "male" , "female" displayed , selected radio buttons instead of using optionscollection/drop down?

here code being used currently

<html:select property="gender">     <html:optionscollection property="genderlist" label="label" value="value"/> </html:select> 

in file, there code

public void reset(actionmapping mapping, httpservletrequest request) {     setgender(null);     setgenderlist(null);      arraylist glist = new arraylist();     glist.add(new labelvaluebean("male", "male"));     glist.add(new labelvaluebean("female", "female"));     setgenderlist(glist); }  public string getgender() {     return gender; }   public void setgender(string gender) {     this.gender = gender; }   public arraylist getgenderlist() {     return genderlist; }   public void setgenderlist(arraylist genderlist) {     this.genderlist = genderlist; } 

i think using struts. hence solution be,

<html:radio property="gender" value="male"> <html:radio property="gender" value="female"> 

you cannot use collections property radio button. there no sense though on using collection radio button. have create radio button tags as needed , while creating have specify value each radio button.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -