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?

  • Best you add the Apex declaration of objVsFieldsMap to the question: are its values a collection? – Keith C Dec 20 '17 at 8:40
  • Share the apex code for this map? – NITHESH K Dec 20 '17 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. – SFDC Mafia - VIC Dec 20 '17 at 8:53
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.