+ Start a Discussion
Vasani ParthVasani Parth 

delete records row wise

I need to include "Del" to delete records row wise . How can i implement with my code . Helpful suggestions and code will be really appreacibale .If there is any other way , please mention that also .Here the code searches for Activities on task object.Thanks in advance .

<apex:page controller="TaskListController">
       <apex:form id="searchForm">
      <apex:PageBlock mode="edit">      
      <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:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>

public class TaskListController
       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 TaskListController(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+'%\' Order By Subject,Status';
  // System.debug(qry);
    SearchResults = Database.query(qry);
   // System.debug(SearchResults);
   return null;
Hi Please see if the solution explained in the below article is helpful

Vasani ParthVasani Parth
I'm looking for something like tthis. Thanks Ramu,but it is not what i'm looking for.Looking for implementing simple things.