2016-10-18 39 views

回答

1

究竟你想從SelectOption項目到字符串列表 - 標籤,值或其他?在任何情況下,您都可以使用getter-methods,比如getLabel()或getValue()並將它們收集到列表中。例如,

List<SelectOption> selectOptions = new List<SelectOption>(); //here it's empty, but you has filled one 
List<String> stringValues = new List<String>(); 
for(SelectOption so: selectOptions){ 
    stringValues.add(so.getValue()); 
} 

//use list of strings as you wish 

您可以找到有關SelectOption方法here的文檔。

+1

感謝Khajiit,它給予了幫助。 – Ashok

相關問題