[SalesForce] displaying map of a map in visualforce(and using inner key as url path of outer key)

Hi I've been trying to figure this out on my own but haven't been able to get it to work. I have a map of a map Map<string,Map<String, list<Accounts>>> mapToAccounts . The inner key is a string which represents an url while the outer key is just the name of the site. I am attempting to create a hyperlink which shows the name of the site and the destination is the inner key(which is an url). Something like this <apex:outputLink value="{!theAccountsOfSitesAndMaps[innerkey]}">{!outerKey}</apex:outputLink> . Any suggestions will be great.

public Map<String,Map<String, list<Accounts>>> getTheAccountsOfSitesAndMaps() {         
    return maptoaccounts;
    }    

Just updated below with suggestions from sfdcfox and Eric but receiving a new error: Error is in expression '{!TheAccountsOfSitesAndMaps[outerKey][innerKey]}' in component in page

 <apex:pageBlock >
    <apex:repeat value="{!TheAccountsOfSitesAndMaps}" var="outerKey">
        <apex:pageBlockTable value="{!TheAccountsOfSitesAndMaps}[outerKey]" var="innerKey">        
          <apex:repeat value="{!TheAccountsOfSitesAndMaps[outerKey][innerKey]}" var="account">
              <apex:column headervalue="Sites" />   
          <apex:outputLink value="{!innerKey}">{!outerKey}</apex:outputLink>            

          </apex:repeat>
        </apex:pageBlockTable>
    </apex:repeat>
</apex:pageBlock>

Best Answer

<apex:repeat value="{!mapToAccounts}" var="outerKey">
    <apex:repeat value="{!mapToAccounts[outerKey]}" var="innerKey">
        <apex:repeat value="{!mapToAccounts[outerKey][innerKey]}" var="account">
            <apex:outputLink value="{!innerKey}">
                {!outerKey}
            </apex:outputLink>
        </apex:repeat>
    </apex:repeat>
</apex:repeat>

Of course, feel free to use tables (apex:dataTable, apex:pageBlockTable, etc) as appropriate, and any other dressing you need.

Related Topic