function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Standardsetcontroller not supported for Task object to do pagination

Want to do pagination on Task object.So far i've implemented inline edit and search box in it.The doc says StandardsetController does not support Task,hence i'm trying to implement it by using Offset.Referring to for pagination .How do implement it ? I'm stucked and really pissed off. Experts please help.

 <apex:page standardController="Task" recordSetVar="tasks" extensions="TaskSearchController">
   <apex:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>

   <apex:form id="searchForm">
   <apex:PageBlock mode="inlineEdit">      
   <apex:pageblockSection id="searchBlockSection">
      <apex:pageBlockSectionItem id="searchBlockSectionItem">
      <apex:outputLabel >Keyword</apex:outputLabel>
      <apex:panelGroup >
            <apex:inputtext id="searchTextBox" value="{!searchText}">
            <apex:commandButton Id="btnSearch" action="{!Search}" rerender="renderBlock" status="status" title="Search" value="Search">                    </apex:commandButton>
<apex:actionStatus id="status" startText="Searching... please wait..."/>      
<apex:pageBlocksection id="renderBlock" >
    <apex:pageblocktable value="{!SearchResults}" var="o" rendered="{!NOT(ISNULL(SearchResults))}">
        <apex:outputLink value="/{!o.Id}">{!o.Subject}</apex:outputLink>
        <apex:column value="{!o.Subject}"/>

// apex

public class TaskSearchController
   public apexpages.standardController controller{get;set;}
   public Task l;
   public List<Task> searchResults {get; set; }

  public string searchText
     if (searchText==null) searchText = '';
     return searchText;

public TaskSearchController(ApexPages.StandardController controller)
    this.controller = controller;
    this.l = (Task) controller.getRecord();

public PageReference search()
  if(SearchResults == null)
    SearchResults = new List<Task>();

  String qry ='Select Id, Subject,Status from Task where Subject like \'%'+searchText+'%\' OR Status like \'%'+searchText+'%\' OR OwnerId like  \'%'+searchText+'%\' Order By Subject,Status';

  SearchResults = Database.query(qry);
  return null;
Best Answer chosen by JosephJ
Hope this post helps

All Answers

Hope this post helps
This was selected as the best answer
Thankis Ramu  for the link . This is what i was looking for..