2011-05-09 90 views

回答

0

假設你申報你的inplaceSelect的folling方式:

<rich:inplaceSelect value="#{bean.value}" defaultLabel="click to edit"> 
    <f:selectItems value="#{bean.selectItems}" /> 
</rich:inplaceSelect> 

你值的類型必須是一個SelectItems的,方含值和標籤。

// populate your selectitems where you need them, getting your data from 
// your database or somewhere else 
List<SelectItem> items = new ArrayList<SelectItem>(); 
items.add(new SelectItem(...)); 

訪問您喜歡的選擇項目集合。

public List<SelectItem> getSelectItems() { 
    return items; 
}