+ Start a Discussion
Ankit Khurana24Ankit Khurana24 

how to create grid on vf page

how to create a grid on vf page ......

1.grid need to show which case has been assigned to whom(loged in users)

2. grid need to contains  maximum of 20 latest  cases.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

vibrationvibration
Ankit KhuranaAnkit Khurana

i wrote this class...so how can i bind it with vf page

public class casegrid
{
     public List<Case> oppz;
     public List<User> uppz;
     
     public List<Case> con{get;set;}
     
     
     
public casegrid()
{
   con=[SELECT Id, OwnerId FROM Case ORDER BY CreatedDate DESC LIMIT 20];



//Select c.OwnerId, c.Id, c.CreatedDate, c.CaseNumber From Case c
//Select u.Username From User u

}
        public List<Case> getOppz()
        {
            for( Case ca:con)
            {
            if (ca.id == null)
             return null;
            oppz = [Select c.OwnerId, c.Id, c.CreatedDate, c.CaseNumber From Case c where c.id = :ca.id];
            
            }
            return oppz;
        }
        public List<User> getUppz()
        {
           for( Case ca:con)
            {
            if (ca.id == null)
             return null;
            uppz = [Select u.Username From User u where u.id = :ca.OwnerId ];
            
            }
            return uppz;
        }
}

 

 

 

 

vf page

 

<apex:page controller="casegrid" >
<apex:pageBlock title="CASE GRID">
<apex:pageBlockTable width="80%" columns="5" rows="20" value="" var="">

</apex:pageBlockTable>

</apex:pageBlock>
</apex:page>