}
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {
ResponseWriter responseWriter = context.getResponseWriter();
UISelectOne selectOne = (UISelectOne) component;
Object object = selectOne.getValue();
responseWriter.startElement("menupopup",null);
Iterator iterator = getSelectItems(context,selectOne);
while(iterator.hasNext()){
SelectItem selectItem = (SelectItem) iterator.next();
responseWriter.startElement("menuitem",null);
responseWriter.writeAttribute("label",selectItem.getLabel(),"label");
responseWriter.writeAttribute("value",getFormattedValue(context,component,selectItem.getValue()),"value");
Object itemValue = selectItem.getValue();
if(itemValue!=null){
if(itemValue.equals(object)){
responseWriter.writeAttribute("selected","true","selected");
}
}
responseWriter.endElement("menuitem");
}
responseWriter.endElement("menupopup");
}