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
RajashriRajashri 

Edit and Delete Hyperlink Code

Hi,

Can anyone please tell me how to write Edit and Delete button code for hyperlink in APEX?

  <apex:outputLink value="{!$Page.Edit}" style="color:blue">Edit</apex:outputLink> 
                                    <apex:outputLink value="{!$Page.Delete}" style="color:blue">|Del</apex:outputLink> 

I want to edit and delete the details of current campaign member 

Thanks

 
Best Answer chosen by Rajashri
praveen murugesanpraveen murugesan
Raja,

You can create a page reference methods in controller and use in action method.

eg 
<apex:form >
   <apex:panelGrid columns="2" rendered="true"> 
      <apex:inputText value="{!searchText}" id="textsearch" rendered="true" />
      <apex:outputLink id="link"  action="{!processLinkClick}">Search
         <apex:param value="{!searchText}" assignTo"{sText}"" name="searchParameter"/>
      </apex:outputLink>
   </apex:panelGrid>
 </apex:form>

 public String sText {get; set;}
 public PageReference processLinkClick() {
    System.debug('sText: '+sText);
    return new PageReference('/apex/VFPageName?searchParameter='+sText);
 }

Mark this as best answer if its helps.

Thanks.

All Answers

RamuRamu (Salesforce Developers) 
The below article might help

http://salesforcesource.blogspot.sg/2009/09/edit-and-delete-command-for-your.html
praveen murugesanpraveen murugesan
Raja,

You can create a page reference methods in controller and use in action method.

eg 
<apex:form >
   <apex:panelGrid columns="2" rendered="true"> 
      <apex:inputText value="{!searchText}" id="textsearch" rendered="true" />
      <apex:outputLink id="link"  action="{!processLinkClick}">Search
         <apex:param value="{!searchText}" assignTo"{sText}"" name="searchParameter"/>
      </apex:outputLink>
   </apex:panelGrid>
 </apex:form>

 public String sText {get; set;}
 public PageReference processLinkClick() {
    System.debug('sText: '+sText);
    return new PageReference('/apex/VFPageName?searchParameter='+sText);
 }

Mark this as best answer if its helps.

Thanks.
This was selected as the best answer