i need to display data from a jsp page using rich:inplaceselect,i would like to give a combination of fist name and lastname as values to rich inplaceselect.my question is how selectitem开发者_高级运维s will be defined in the bean?and of what type it would be?
Assuming you declare your inplaceSelect the folling way:
<rich:inplaceSelect value="#{bean.value}" defaultLabel="click to edit">
<f:selectItems value="#{bean.selectItems}" />
</rich:inplaceSelect>
Your values must be of type SelectItems, containg a value and a label.
// 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(...));
Access your select items collections like this.
public List<SelectItem> getSelectItems() {
return items;
}
精彩评论