0

I have below code in my VF page -

<tbody>
  <apex:repeat value="{!objVsFieldsMap}" var="key" id="theObjReapter1">
     <tr>
       <td>{!key}</td>
       <apex:repeat value="{!objVsFieldsMap[key]}" var="lstVal">
         <td><p>{!lstVal.val}</p></td>
       </apex:repeat>
     </tr>
  </apex:repeat>
</tbody>

And I'm not able to save the VF page. It shows me Syntax error. Found 'objVsFieldsMap'. The strange thing is the same kind of code is working for other VF page. Any idea about it?

3
  • Best you add the Apex declaration of objVsFieldsMap to the question: are its values a collection?
    – Keith C
    Commented Dec 20, 2017 at 8:40
  • Share the apex code for this map?
    – NITHESH K
    Commented Dec 20, 2017 at 8:44
  • Got resolved. I don't know what was wrong. I just created another VF page and copied code from the current one which had issue. Anyway thanks every one.
    – Vickal
    Commented Dec 20, 2017 at 8:53

1 Answer 1

0

You are passing the same key store the ids in set or any other do something like this

public class toda {
Public Map<Id,Account> acc {get;set;}
public set <Id> ids {get;set;}
public toda ()
{
    ids  = new Set<Id>();
    acc = New   Map<Id,Account>([Select Id,Name From Account limit 100]);
 for(Account acc :acc .Values() {
  ids .add(acc.Id);
 }
}} 

Use that Id in place of key

0

You must log in to answer this question.

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