0

I've got a structure like this in apex public Map <string, List <custom__c>> extIdTOSFRecords{get; set;}

In a column in visualforce I can feed the map the key. I want to:

  1. iterate over the custom objects
  2. access some fields in each list element

I tried this syntax, but it's not working

<apex:variable value="{!item.customfield__c}" var="mapKey"/>

extIdTOSFRecords[mapKey]-->{!extIdTOSFRecords[mapKey]}<br/>

Results

extIdTOSFRecords[mapKey]--> extIdTOSFRecords[mapKey]-->[]

how do I work with this data structure?

1
  • You need to bind the Map items with pageblocktable ?
    – highfive
    Sep 10, 2015 at 3:42

1 Answer 1

2

You can iterate over a Map and bind with apex:pageBlockTables as below.

<apex:repeat value="{!extIdTOSFRecords}" var="key">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!extIdTOSFRecords[key]}" var="listItem">
            <apex:column value="{!listItem.YOUR_CUS_OBJ_FIELD}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:repeat>
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .