JSF-2 f: selectItems com Map não exibe itemLabel
Quando eu uso f: selectItems para exibir itens em um mapa, não consigo exibir o valor do item Map, somente a chave. f: selectItems não usa o itemLabel em tudo. Quando eu uso uma lista, as coisas funcionam.
O seguinte faz uso do itemLabel para exibir a "descrição" de um item em uma lista:
<h:selectOneMenu>
<f:selectItems value="#{testBB.testList}" var="s"
itemLabel="TEST #{s.description}" itemValue="#{TEST s.name}" />
</h:
selectOneMenu>
A seguinte tentativa de exibir o valor de um item em um mapa não funciona. Ele exibe a chave do item, mas não usa o atributo itemLabel, como pode ser discernido por essa falta de saída do texto "TEST".
<rich:select>
<f:selectItems value="#{testBB.testMap}" var="s"
itemLabel="TEST #{s.value}" itemValue="TEST #{s.key}" />
</rich:select>
O simples backing bean usado segue:
public class TestBB {
private Map<String, String> testMap;
private List<TestItem> testList;
public TestBB() {
testMap = new HashMap<String, String>();
testMap.put("1_key", "Item One");
testMap.put("2_key", "Item Two");
testMap.put("3_key", "Item Three");
testList = new ArrayList<TestItem>();
testList.add( new TestItem("name_1", "description_1") );
testList.add( new TestItem("name_2", "description_2") );
testList.add( new TestItem("name_3", "description_3") );
}
public Map<String, String> getTestMap() {
return testMap;
}
public List<TestItem> getTestList() {
return testList;
}
}
Então, alguma idéia de como fazer isso funcionar, ou seja, como usar efetivamente um mapa com selectItems?