+ Start a Discussion
Mecrin Luvis 1Mecrin Luvis 1 

Wrapper Class

Hi Guys,  
Please any one can explain,by using one date field,how to  display the list odf the records in  page block table by using wrapper class 
salesforce mesalesforce me
Hi check it once....
<apex:page standardController="Lead" extensions="opentasks" >
    <apex:form >
        <apex:pageBlock title="open Tasks" mode="edit" id="opnTsks"> 
            <apex:Messages />         
            <center><a href="https://ap1.salesforce.com/00T/e?who_id={!leadld}&retURL={!leadld}" target="_top"><button type="button">New Task</button></a>
                <apex:commandButton value="close" action="{!close}" rerender="opnTsks"/>
            <apex:pageBlockTable value="{!listwrapper}" var="each" >
                <apex:column headerValue="Action">
                     <apex:inputCheckbox value="{!each.checked}"/>
                    <apex:outputlink value="/{!each.k.id}/e?retURL={!each.k.WhoId}" target="_top"> Edit </apex:outputlink>
                <apex:column headerValue="Subject" value="{!each.k.Subject}"/>
                <apex:column headerValue="ActiveDate" value="{!each.k.ActivityDate}"/>
                <apex:column headerValue="Status" value="{!each.k.Status}"/>
public class opentasks {
    public List<OpenActivity> open{get;set;}
    public Id leadld{get;set;}
    public list<wrapperclass> listwrapper{get;set;}
    public opentasks(ApexPages.StandardController controller){
        leadld = ApexPages.CurrentPage().getparameters().get('id');
        list<task> open1 =new list<Task>(); 
        listwrapper = new list<wrapperclass>();
        list<lead>   le =[SELECT Name, (Select Id,Subject, WhoId, ActivityDate,Status, Priority, OwnerId FROM Tasks WHERE IsClosed=false) 
                            FROM Lead WHERE Id = :leadld];
            for(Task k:le[0].Tasks)
                listwrapper.add(new Wrapperclass(k));
    public class wrapperclass
        public  boolean checked{get;set;}
        public Task k{get;set;}
        public Wrapperclass(Task k){
    public PageReference close()
        list<Task> listofopen=new list<Task>();
            for(Integer i=0; i < listwrapper.size();i++)
                wrapperclass w = listwrapper[i];
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Select atleast one column t'));
            update listofopen;    
        return null;

Mecrin Luvis 1Mecrin Luvis 1
Hi Sir,

That what you sent me.... Its working. But mine requirement is..... I have created Date field on lead object. When i select the date from that field and click on search button,it will display the list of the records of that lead object.fromthat start date to end date.