I have a Map
of key / values, which I initialize in @PostConstruct
as follows:
Map<String, String> myMap;
@PostConstruct
public void init() {
myMap=new LinkedHashMap<String, String>();
myMap.put("myKey","myValue");
}
public Map<String, String> getMyMap() {
return myMap;
}
public void setMyMap(Map<String, String> myMap) {
this.myMap = myMap;
}
When I try to iterate over this Map with <ui:repeat>
like shown bellow, and I set a break point on the getter for the Map, I notice that it is not getting called, and so nothing is printed:
<ice:panelGroup>
<ui:repeat items="#{myBean.myMap}" var="entry" varStatus="loop">
<input type="checkbox" name="myCheckBoxes" value="#{entry.value}" />
<span class="#{fn:contains(entry.value,'g') ? 'bold-style' : ''}">#{entry.key}</span>
</ui:repeat>
</ice:panelGroup>
But when replacing above code with <c:foreach>
, everything works fine, and the list is printed as expected, any ideas why I am getting such behavior?