+ 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:inputtext>
                <apex:commandButton Id="btnSearch" action="{!Search}" rerender="renderBlock" status="status" title="Search" value="Search">                    </apex:commandButton>
            </apex:panelGroup>
        </apex:pageBlockSectionItem>
    </apex:pageblockSection>
    <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:pageblocktable>     
    </apex:pageBlocksection>
   </apex:pageblock>
  </apex:form>
  <apex:enhancedlist type="Activity" height="800" rowsPerPage="50" customizable="False"/>
   </apex:page>



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

      public string searchText
      {
       get
       {
         if (searchText==null) searchText = '';
         return searchText;
       }
      set;
       }

     public TaskListController(ApexPages.StandardController controller)
     {
        this.controller = controller;
        this.l = (Task) controller.getRecord();
      }

    public PageReference search()
    {
      if(SearchResults == null)
      {
        SearchResults = new List<Task>();
      }
     else
     {
        SearchResults.Clear();
     }

     String qry = 'Select Id, Subject,Status from Task where Subject like \'%'+searchText+'%\' Order By Subject,Status';
  // System.debug(qry);
    SearchResults = Database.query(qry);
SearchResults.sort();
   // System.debug(SearchResults);
   return null;
    }
   }
Ramu_SFDCRamu_SFDC
Hi Please see if the solution explained in the below article is helpful

http://salesforce.stackexchange.com/questions/10903/removing-rows-separately-from-the-visualforce-pageblocktable-list
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.