Hi,
I am trying to append an option into a drop down list using
HtmlSelect's appendOption.
Is there a reason why this might not work on a list ?
This is what I am trying to do:
HtmlSelect dropDownList = (HtmlSelect)myForm.getSelectByName("cars");
Map attributesMap = new HashMap();
attributesMap.put("text","ford");
attributesMap.put("value","FORD");
HtmlOption newOption = new HtmlOption(myPage,attributesMap);
dropDownList.appendOption(newOption);
myPage contains myForm which in turn contains dropDownList
This works on a testpage(page on my machine) but when I try a similar
thing on a different site, I am unable to add the new option. I looked
into the options in the drop down list using
dropDownList.getAllOptions().
Best Regards
Vinay
|