I want to populate my listbox from the field called 'fundlist' in my ActionForm(named as myForm).The getFundlist() returns an ArrayList of funds.Please validate if the same should be implemented in the foll. way
I understand that if i'm not using the Struts <html ptions collection> tag, I would have been iterating through my Arraylist to populate the Listbox. How would it be done using the above code ?
ActionForm should have public String getSelectedFund() public void setSelectedFund(String fund) and public List getFundList()
iterator is not necessary. Struts will use its magic for prepopulation and preselection if you do the above.
Joined: Oct 30, 2002
Thanks Marc for being so patient But my getSelectedFund() returns an ArrayList(and not String) which I want to populate in the Listbox. If it was returning a String, i understand that the String value would have got populated in the Listbox but am worried because it returns me multiple funds