Hello,
I'm trying to populate a dropDown using h:selectOneMenu and f:selecItems tag using HashMap<String,String> values
I understand when displaying drop down using f:selectItems tag populates the drop down label using HashMap Key and value using HashMap value,
is there a way to populate dropdown label using hashmap value and drop down value as hashmap value
I came across few solutions like
1.swap the key/value in Map before passing it to f:selectItems
2.construct selectItem list in java and pass the list to UI
but i dont think both of the above two ideas are better,
I'm using EL1.2 version which doesn't support map.entrySet() in populating f:selectItems like
<f:selectItems value="#{bean.map.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}" />
is there any other way to solve this?
Thanks,
Sudha
I'm trying to populate a dropDown using h:selectOneMenu and f:selecItems tag using HashMap<String,String> values
I understand when displaying drop down using f:selectItems tag populates the drop down label using HashMap Key and value using HashMap value,
is there a way to populate dropdown label using hashmap value and drop down value as hashmap value
I came across few solutions like
1.swap the key/value in Map before passing it to f:selectItems
2.construct selectItem list in java and pass the list to UI
but i dont think both of the above two ideas are better,
I'm using EL1.2 version which doesn't support map.entrySet() in populating f:selectItems like
<f:selectItems value="#{bean.map.entrySet()}" var="entry"
itemValue="#{entry.key}" itemLabel="#{entry.value}" />
is there any other way to solve this?
Thanks,
Sudha