want to know IE compatibility with ListItems
Hi,
I have written below function in my java file which Generates List Of Items used for Drop Down List in HTML. Also selects a default value if present. It is working fine with mozilla and mozilla firefox browsers but don't know why it is discarding first element of drop down list in Internet explorer..? in IE it selecting 2nd element by default discrading first element from the list....Is it IE compatibility issue or am I doing wrong..?
Let me know plz.
public static String getListItemsInHtml (ListItem[] aListItems, String aSelectedItem, boolean aIsBlankItemRequired){
StringBuffer buffer = new StringBuffer();
if (aIsBlankItemRequired)
buffer.append ("<option value=\"\"> </option>");
if(aListItems != null && aListItems.length > 0) {
String itemValue = null;
for(int i=0; i<aListItems.length; i++) {
itemValue = aListItems.getValue();
buffer.append("><option value=\"" + itemValue + "\"");
if (aSelectedItem != null && aSelectedItem.equals (itemValue)) {
buffer.append(" selected ");
}
buffer.append(">");
buffer.append(aListItems.getName());
buffer.append("</option>");
}
}
return buffer.toString();
}

