0

I am have a list of maps , each map contains number of values List<Map<Integer, String>> recordsList what I need to do is to iterate over the list and iterate also over each value in each map to form a table, this is my code

<table>
  <tr>
    <ui:repeat id="record-table" var="c" value="#{Bean.recordsList}">
        <tr>
          <ui:repeat var="m" value="#{c.values}">
            <td>#{m}</td>
          </ui:repeat>
        </tr>
    </ui:repeat>
   </tr> 
</table>

My problem is this is not working, how to make it work?? Thanks in advance.

Yara Mousa
  • 79
  • 6
  • 15

2 Answers2

0

Unfortunately ui:repeat don't support iteration over maps. Follow the link for more details: ui:repeat doesn't work with Map

Community
  • 1
  • 1
HJK
  • 1,382
  • 2
  • 9
  • 19
0

You cannot directly using a Map with ui:repeat.

You could output the key and value like this however:

<ui:repeat var="key" value="#{c.values.keySet().toArray()}">
    <td>key:#{key}</td>
    <td>value:#{c.values.get(key)}</td>
</ui:repeat>
JamesB
  • 7,774
  • 2
  • 22
  • 21