You need to sign in to do that
Don't have an account?
Visualforce : "This map cannot be used in an iteration because the keys cannot be sorted"
Hello,
I have a scenario to display data in tree structure for that am using approach of map on visudalforce page.
The map structure look like
Map<A,Map<B,List<C>>> mymap = new Map<A,Map<B,List<C>>>();
Where A,B,C are wrapper classes in which I have implemented the equal and hashcode method.
Am able to generate the map data properly in Apex controlller and when iterating it on VF page it giving the mentioned error.
On VF page code look like
<apex:repeat value="{!mymap}" var="m">
{!m.name}
<apex:repeat value="{!mymap[m]}" var="p">
{!p.name}
<apex:repeat value="{!mymap[m][p]}" var="q">
{!q.Name}
</apex:repeat>
</apex:repeat>
</apex:repeat>
Please let me know if I did any thing wrong which causing this error.
Thanks in advance.
Below is the sample wrapper class.
Using this you can display data like below
This is just an idea if it is helpfull to you.