I'm using Richfaces JSF and I want to iterate over an Map<Object,Object>
. I see many examples on Sun forums and other sites but in my case it doesn't work. Here is my XHTML code:
<c:forEach items="#{order.customOptions}" var="option">
<h:outputText value="this text does not print" />
<h:outputText value="#{option.value.name}" />
<h:outputText value="#{option.value.key}" />
</c:forEach>
The "order" object is of type Order
. The "customOptios" is of type Map<CustomOption,CustomOptionValue>
. When I create an Javascript alert on to print '#{order.customeOptions}' its content is correct, but it does not even enter in c:forEach loop
.
Update 1:: I tried a list but it doesn't work. I used list and got answer in other pages. I also use a4j:poll
and some other ajax component is there any problem with them?
<c:forEach items="#{order.food.cusomableOptions}" var="option">
<h:outputText value="this text does not print" />
<h:outputText value="#{option.title}" />
</c:forEach>
Update 2: Here is output of <h:outputText value="#{order.customOptions}" />
:
{model.CustomOption@be8464=model.CustomOptionValue@14e8ac9,
model.CustomOption@1ea0c8b=model.CustomOptionValue@78f4,
model.CustomOption@24389c=model.CustomOptionValue@3f0bc0,
model.CustomOption@a765c=model.CustomOptionValue@3b34ca,
model.CustomOption@95868c=model.CustomOptionValue@199de59}
Update 3: when I use it outside of rich:column
it works,
but when I use it in a rich:dataTable
and rich:column
tag it doesn't work:
<rich:column>
<f:facet name="header">
<h:outputText value="xf" />
</f:facet>
<c:forEach items="#{order.customOptions}" var="option">
<p><h:outputText value="option : #{option.key.title}" /></p>
</c:forEach>
</rich:column>