I have a combo on my page that I want to fill with some keywords from the configuration. I want to use a managed bean to execute it.
Say I have a bean called Config, where there is a Category field List ...
public class Configuration implements Serializable {
private static final long serialVersionUID = 1L;
private List<String> categories;
public List<String> getCategories() {
if (categories == null)
categories = getCats();
return categories;
}
}
When I use this field for my combo, it works well ...
<xp:comboBox>
<xp:selectItems>
<xp:this.value><![CDATA[#{config.categories}]]></xp:this.value>
</xp:selectItems>
</xp:comboBox>
But this is just a list of shortcuts. I also need values. How to fill selectItems with my combo with two lines - label and value?
EDIT:
I tried to create a Combo object with labels and value fields and use repeat within my comboBox.
<xp:comboBox>
<xp:repeat id="repeat1" value="#{config.combo}" var="c" rows="30">
<xp:selectItem itemLabel="#{c.label}" itemValue="#{c.value}" />
</xp:repeat>
</xp:comboBox>
Still not working...: - (
Jikra source
share