Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

Using Map In Your VF Pages

Be First!
by March 23, 2012 APEX, Visual Force
APEX CLASS:
 public class TestMapController{
    
     public map data {get;set;}
    
     public TestMapController(){
         data = new map();
         for(Account acc: [Select Id, Name, (Select Id, Name, Email from Contacts), Phone from Account]){
             integer count = data.get(acc.name);
             if(count != null)
                count++;
            else
                count = 1;
            data.put(acc.name, count);
        }
    }
}
VisualForce Page:

 
 
    
         {!d}
    

    
         {!data[d]}
    

 

 

(411)

Previous
Next

Leave a Reply